Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

android - ImportError: No module named oauth2client

I'm following instructions in the Google Sign-In for Android documentation (https://developers.google.com/identity/sign-in/android/backend-auth) and am trying to implement the token verification in my Python code.

I am developing on local host. For some reason, I am getting this error when I try this import from oauth2client import client, crypt into my Google App Engine backend, I get this error:

ImportError: No module named oauth2client.client`

I've installed oauth2 using sudo pip install --upgrade google-api-python (https://developers.google.com/api-client-library/python/start/installation). The installation log shows:

Requirement already up-to-date: google-api-python-client in /usr/local/lib/python2.7/dist-packages/google_api_python_client-1.5.0-py2.7.egg
Requirement already up-to-date: httplib2>=0.8,<1 in /usr/local/lib/python2.7/dist-packages (from google-api-python-client)
Downloading/unpacking oauth2client>=2.0.0,<3 from https://pypi.python.org/packages/source/o/oauth2client/oauth2client-2.0.0.post1.tar.gz#md5=6309e12fe2bc0f038708e2c9ec4b1f69 (from google-api-python-client)
Downloading oauth2client-2.0.0.post1.tar.gz (66kB): 66kB downloaded
Running setup.py (path:/tmp/pip_build_root/oauth2client/setup.py) egg_info for package oauth2client
warning: no previously-included files matching '*' found under directory 'tests'
Requirement already up-to-date: six>=1.6.1,<2 in /usr/local/lib/python2.7/dist-packages (from google-api-python-client)
Requirement already up-to-date: uritemplate>=0.6,<1 in /usr/local/lib/python2.7/dist-packages (from google-api-python-client)
Requirement already up-to-date: pyasn1>=0.1.7 in /usr/local/lib/python2.7/dist-packages (from oauth2client>=2.0.0,<3->google-api-python-client)
Requirement already up-to-date: pyasn1-modules>=0.0.5 in /usr/local/lib/python2.7/dist-packages (from oauth2client>=2.0.0,<3->google-api-python-client)
Requirement already up-to-date: rsa>=3.1.4 in /usr/local/lib/python2.7/dist-packages (from oauth2client>=2.0.0,<3->google-api-python-client)
Requirement already up-to-date: simplejson>=2.5.0 in /usr/local/lib/python2.7/dist-packages (from uritemplate>=0.6,<1->google-api-python-client)
Installing collected packages: oauth2client
Found existing installation: oauth2client 2.0.0-post1
Uninstalling oauth2client:
Successfully uninstalled oauth2client
Running setup.py install for oauth2client
warning: no previously-included files matching '*' found under directory 'tests'
Successfully installed oauth2client

I see that someone has provided an answer, but I don't know how to do this symlink that is described here: the Google app engine(python) ImportError: No module named oauth2 in google app engine

I'm thinking this has something to do with the path, but I have no idea how to set it so that oauth2client is installed globally. I am running Ubuntu 14.04 LTS on a VM.

Any help would be appreciated.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...