Google-api-python-client: ImportError: No module named 'oauth2client.contrib.locked_file'

Created on 8 Aug 2017  路  8Comments  路  Source: googleapis/google-api-python-client

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/katsarov/miniconda3/envs/kpi_dashboard/lib/python3.5/site-packages/googleapiclient/discovery_cache/file_cache.py", line 33, in
from oauth2client.contrib.locked_file import LockedFile
ImportError: No module named 'oauth2client.contrib.locked_file'

Traceback (most recent call last):
File "/home/katsarov/miniconda3/envs/kpi_dashboard/lib/python3.5/site-packages/googleapiclient/discovery_cache/__init__.py", line 41, in autodetect
from . import file_cache
File "/home/katsarov/miniconda3/envs/kpi_dashboard/lib/python3.5/site-packages/googleapiclient/discovery_cache/file_cache.py", line 41, in
'file_cache is unavailable when using oauth2client >= 4.0.0')
ImportError: file_cache is unavailable when using oauth2client >= 4.0.0

triage me

Most helpful comment

ImportError is warning? Ok

All 8 comments

@katsar0v this is not en error, just a warning. See #345.

ImportError is warning? Ok

馃

any remedies?

Any updates?

same

Hi folks, here's some more explanation since there seems to be interest:

This is a warning, that happens to log the exceptions that were raised. The ImportError is being caught and handled (see code snippet below). This function determines what environment the code is being run to choose the correct cache location. Each import will only work in a specific environment.

https://github.com/googleapis/google-api-python-client/blob/66bb32cc70353296dbf1876ae8c22baf6562cfb9/googleapiclient/discovery_cache/__init__.py#L28-L47

If you have comments to make about a closed issue it's best to open a new issue and reference the previous one. Repository maintainers are less likely to see comments on an already closed issue.

Thanks!

Disable cache_discovery

discovery.build(api, version, http=http, cache_discovery=False)

https://stackoverflow.com/questions/40154672/importerror-file-cache-is-unavailable-when-using-python-client-for-google-ser

Was this page helpful?
0 / 5 - 0 ratings