pip install gcloud causes python to raise errors
See original GitHub issue(using a fresh conda env to demonstrate):
conda create -n gcloud-test python=3 -y
source activate gcloud-test
pip install gcloud
python -c "print('hello world')"
output:
Error processing line 2 of /Users/jlowin/anaconda/envs/gcloud-test/lib/python3.5/site-packages/googleapis_common_protos-1.1.0-py3.5-nspkg.pth:
Traceback (most recent call last):
File "/Users/jlowin/anaconda/envs/gcloud-test/lib/python3.5/site.py", line 167, in addpackage
exec(line)
File "<string>", line 1, in <module>
KeyError: 'google'
Remainder of file ignored
hello world
After some trial and error, it looks like the current version of protobuf (3.0.0b2.post1) is causing the problem. Based on the solution to #1304, reverting to a prior version resolves it (or at least suppresses the error):
pip install protobuf==3.0.0b1.post2
python -c "print('hello world')"
clean up:
source deactivate
conda env remove -n gcloud-test -y
Issue Analytics
- State:
- Created 8 years ago
- Reactions:2
- Comments:20 (8 by maintainers)
Top Results From Across the Web
installing google-cloud using pip fails - python - Stack Overflow
I tried running pip install but it gives the same namespace error. My pip (actually pip3) is unusable. I purged both it and...
Read more >Troubleshooting PyPI package installation | Cloud Composer
When a package installation fails, pip reports the detailed error message. You can find this error message in the build logs.
Read more >Installing Python Dependencies in Dataflow | Google Cloud
In this section, we will see some common problems that have the root cause in python dependency installation. Package Build Error with --requirements_file....
Read more >Python quickstart | Google Drive
Create a Python command-line application that makes requests to the Drive API. ... pip install --upgrade google-api-python-client google-auth-httplib2 ...
Read more >apache-airflow-providers-google 8.6.0 - PyPI
google-cloud -aiplatform ... pip install apache-airflow-providers-google[amazon] ... Don't throw an exception when a BQ cusor job has no schema (#26096).
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I encountered this problem and it was caused by having https://pypi.python.org/pypi/google installed.
Removing this package and reinstall’ing google-cloud resolved the issue (I verified this by reinstalling ‘google’ and the problem regressed).
Glad to hear it’s working!