GoogleCloudPlatform / gsutil

A command line tool for interacting with cloud storage services.
Apache License 2.0
874 stars 334 forks source link

all commands fail with ImportError: No module named gce #330

Closed ayush--s closed 8 years ago

ayush--s commented 8 years ago
(py2) [ayush@devbox]$ gsutil ls gs://uspto-pair
Traceback (most recent call last):
  File "/opt/py2/bin/gsutil", line 9, in <module>
    load_entry_point('gsutil==4.16', 'console_scripts', 'gsutil')()
  File "/opt/py2/lib/python2.7/site-packages/pkg_resources/__init__.py", line 547, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/opt/py2/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2719, in load_entry_point
    return ep.load()
  File "/opt/py2/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2379, in load
    return self.resolve()
  File "/opt/py2/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2385, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "build/bdist.linux-x86_64/egg/gslib/__main__.py", line 53, in <module>
  File "build/bdist.linux-x86_64/egg/gslib/wildcard_iterator.py", line 37, in <module>
  File "build/bdist.linux-x86_64/egg/gslib/translation_helper.py", line 25, in <module>
  File "/opt/py2/lib/python2.7/site-packages/google_apitools-0.4.12-py2.7.egg/apitools/base/py/__init__.py", line 20, in <module>
    from apitools.base.py.base_api import *
  File "/opt/py2/lib/python2.7/site-packages/google_apitools-0.4.12-py2.7.egg/apitools/base/py/base_api.py", line 33, in <module>
    from apitools.base.py import credentials_lib
  File "/opt/py2/lib/python2.7/site-packages/google_apitools-0.4.12-py2.7.egg/apitools/base/py/credentials_lib.py", line 28, in <module>
    import oauth2client.gce
ImportError: No module named gce

temp fix: oauth2client.gce has moved to oauth2client.contrib.gce

camilb commented 8 years ago

Another temp fix: pip install 'oauth2client==1.5.2' --force-reinstall

thobrla commented 8 years ago

Thanks - that workaround is the best we have for now, but we'll try to get out a release soon that pins to 1.5.2 (or supports the module path changes in 2.0.0).

ayush--s commented 8 years ago

also needs pip install 'google-apitools==0.4.12' --force-reinstall along with @camilb 's comment to work correctly

yodax commented 8 years ago

Another temp fix: pip install 'oauth2client==1.5.2' --force-reinstall

That worked for me, didn't need to reinstall google-apitools.

Thanks for the help :)

thobrla commented 8 years ago

gsutil 4.17 was just pushed to PyPi - this should now be fixed.

Andrewm4894pmc commented 8 years ago

I'm getting this error today - seems a bit transient:

Traceback (most recent call last): File "/usr/bin/../lib/google-cloud-sdk/bin/bootstrapping/bq.py", line 10, in import bootstrapping File "/usr/lib/google-cloud-sdk/bin/bootstrapping/bootstrapping.py", line 17, in import oauth2client.contrib.gce as gce ImportError: No module named contrib.gce

thobrla commented 8 years ago

@Andrewm4894pmc it looks like this is an issue with the bq tool, not gsutil. Could you file an issue on the Cloud SDK issue tracker?

Andrewm4894pmc commented 8 years ago

Done, cheers

https://code.google.com/p/google-cloud-sdk/issues/detail?id=677&thanks=677&ts=1458675091