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

No module named 'oauth2client.contrib.locked_file' #25

Open
fridde opened this issue Nov 28, 2020 · 2 comments
Open

No module named 'oauth2client.contrib.locked_file' #25

fridde opened this issue Nov 28, 2020 · 2 comments

Comments

@fridde
Copy link

fridde commented Nov 28, 2020

First of all: Thanks for a great package!

When running ezgmail "live" from the python interpreter, everything works just fine, but as I am trying to build
a script and run it from my bash, I get this weird exception, but still correct results.

I could just suppress the errors, but since this could lead to problems later on, I thought I'd report it.

Any idea as to what could cause this?

I am running Python 3.8 on WSL (Ubuntu 20.04) and have the most current version of this package.

WARNING:googleapiclient.discovery_cache:file_cache is unavailable when using oauth2client >= 4.0.0 or google-auth
Traceback (most recent call last):
  File "/home/fridde/.local/lib/python3.8/site-packages/googleapiclient/discovery_cache/file_cache.py", line 33, in <module>
    from oauth2client.contrib.locked_file import LockedFile
ModuleNotFoundError: No module named 'oauth2client.contrib.locked_file'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/fridde/.local/lib/python3.8/site-packages/googleapiclient/discovery_cache/file_cache.py", line 37, in <module>
    from oauth2client.locked_file import LockedFile
ModuleNotFoundError: No module named 'oauth2client.locked_file'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/fridde/.local/lib/python3.8/site-packages/googleapiclient/discovery_cache/__init__.py", line 44, in autodetect
    from . import file_cache
  File "/home/fridde/.local/lib/python3.8/site-packages/googleapiclient/discovery_cache/file_cache.py", line 40, in <module>
    raise ImportError(
ImportError: file_cache is unavailable when using oauth2client >= 4.0.0 or google-auth
@cgarrett
Copy link

cgarrett commented Dec 3, 2020

This appears to be a warning indicating the Exception is being handled correctly. Check these two issues out for more information:
googleapis/google-api-python-client#427
googleapis/google-api-python-client#299

You may be able to silence the warning by adding this to your code:

import logging

logging.getLogger('googleapicliet.discovery_cache').setLevel(logging.ERROR)

@parthea
Copy link

parthea commented Dec 8, 2020

As of yesterday, the error level has changed from warning to info in google-api-python-client. See googleapis/google-api-python-client#1125.

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

3 participants