Thanks to visit codestin.com
Credit goes to github.com

Skip to content

pip install gcloud causes python to raise errors #1570

@jlowin

Description

@jlowin

(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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions