google-api-python-client icon indicating copy to clipboard operation
google-api-python-client copied to clipboard

ImportError: No module named 'oauth2client.contrib.locked_file'

Open katsar0v opened this issue 9 years ago • 8 comments

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

katsar0v avatar Aug 08 '17 15:08 katsar0v

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

theacodes avatar Aug 08 '17 15:08 theacodes

ImportError is warning? Ok

katsar0v avatar Aug 09 '17 08:08 katsar0v

🥇

benminer avatar Jun 10 '19 00:06 benminer

any remedies?

ucalyptus avatar Sep 03 '19 10:09 ucalyptus

Any updates?

lliepins-clgx avatar Feb 17 '20 15:02 lliepins-clgx

same

Mabloq avatar Feb 20 '20 00:02 Mabloq

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!

busunkim96 avatar Feb 20 '20 01:02 busunkim96

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

adammickman avatar Dec 02 '20 15:12 adammickman