question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:closed
  • Created 8 years ago
  • Reactions:2
  • Comments:20 (8 by maintainers)

github_iconTop GitHub Comments

8reactions
brianrussocommented, Nov 7, 2016

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).

1reaction
daspecstercommented, Feb 2, 2017

Glad to hear it’s working!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found