You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using Python 3.7
I'm trying to list the files of a directory using the method Use Service account.
I'm getting an error with a traceback which does not break the code (I get the list of files) but it is a bit annoying.
I did a bit of research and making a small modification I got it working without the error. I'm making a PR so you can check and test it.
resource = {
... "service_account": get_credentials(),
... "id": parent_folder_id,
... "fields": "files(name,id,mimeType)",
... }
res = getfilelist.GetFileList(resource)
2020-08-10 10:22:37,921 :: googleapiclient.discovery_cache :: WARNING :: file_cache is unavailable when using oauth2client >= 4.0.0 or google-auth
Traceback (most recent call last):
File "/Users/myuser/workspace/venvs/getfilelistpy/lib/python3.7/site-packages/googleapiclient/discovery_cache/file_cache.py", line 33, in <module>
from oauth2client.contrib.locked_file import LockedFile
File "/Users/myuser/Library/Application Support/JetBrains/Toolbox/apps/PyCharm-P/ch-0/201.8743.11/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
ModuleNotFoundError: No module named 'oauth2client.contrib.locked_file'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/mysuer/workspace/venvs/getfilelistpy/lib/python3.7/site-packages/googleapiclient/discovery_cache/file_cache.py", line 37, in <module>
from oauth2client.locked_file import LockedFile
File "/Users/myuser/Library/Application Support/JetBrains/Toolbox/apps/PyCharm-P/ch-0/201.8743.11/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
ModuleNotFoundError: No module named 'oauth2client.locked_file'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/myuser/workspace/venvs/getfilelistpy/lib/python3.7/site-packages/googleapiclient/discovery_cache/__init__.py", line 44, in autodetect
from . import file_cache
File "/Users/myuser/Library/Application Support/JetBrains/Toolbox/apps/PyCharm-P/ch-0/201.8743.11/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "/Users/myuser/workspace/venvs/getfilelistpy/lib/python3.7/site-packages/googleapiclient/discovery_cache/file_cache.py", line 41, in <module>
"file_cache is unavailable when using oauth2client >= 4.0.0 or google-auth"
ImportError: file_cache is unavailable when using oauth2client >= 4.0.0 or google-auth
2020-08-10 10:22:38,244 :: oauth2client.transport :: INFO :: Attempting refresh to obtain initial access_token
2020-08-10 10:22:38,283 :: oauth2client.client :: INFO :: Refreshing access_token
The text was updated successfully, but these errors were encountered:
I'm using Python 3.7
I'm trying to list the files of a directory using the method
Use Service account
.I'm getting an error with a traceback which does not break the code (I get the list of files) but it is a bit annoying.
I did a bit of research and making a small modification I got it working without the error. I'm making a PR so you can check and test it.
The text was updated successfully, but these errors were encountered: