Reputation: 113
I have installed google-api-python-client library using pip3.4 Iam following tutorial from google authenicating client library so every time i run the python code provided by google to authenticate client library throws error as
import clientsecrets ImportError: No module named 'clientsecrets'
I have only python3.4 running on my pc and no other python. it might be similar thread to one here Python can't find module 'clientsecrets' when trying to set up oauth2 in Django using the Google Python API but i found no solution there.
The python code i got from google is here https://developers.google.com/maps/documentation/tracks/auth#authenticating_using_a_client_library
Upvotes: 3
Views: 1177
Reputation: 221
The library doesn't support Python 3. As of PEP 404:
In Python 3, implicit relative imports within packages are no longer available - only absolute imports and explicit relative imports are supported.
The oauth2client
library uses import clientsecrets
, which for Python 3 would need to be rewritten as from . import clientsecrets
. Even if you changed those, the rest of the library would still be incompatible with Python 3.
There's at least one fork for Python 3 development, but it doesn't seem to be a big priority for the project. Until then, you'll have to find another library or write a wrapper yourself with requests
for the functionality you need.
Upvotes: 1