This problem is solved by installing office365-rest-python-client instead of office365-rest-client.
I want to upload some files to sharepoint via office365 REST Python client.
On documentation on github, I found two examples:

one for larger files where this is executed:

 uploaded_file = target_folder.files.create_upload_session(local_path, size_chunk, print_upload_progress).execute_query()

one for small files :
target_file = target_folder.upload_file(name, file_content).execute_query() .

In my case, I want to be able to upload files who are small and also files who are very large.
For testing, I wanted to see if the method for larger files works with smaller files too.
With a small file, while putting the size_chunk at 1Mb, the uploading was done, but the file uploaded was empty (0b), so I lost my content while uploading.
I wanted to know if there is someone who knows how can we do something more generic for whatever size of files. Also I don't understand what is the size chunk for larger files case. Do you know how one should choose it?
Thank you so much!
Uploading files of different sizes on sharepoint office365 REST Python Client