Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModuleNotFoundError #3

Open
chozelinek opened this issue Aug 10, 2020 · 0 comments
Open

ModuleNotFoundError #3

chozelinek opened this issue Aug 10, 2020 · 0 comments

Comments

@chozelinek
Copy link

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant