google-cloud-python: google-cloud 0.20.0 'from google.cloud import storage' not working
After upgrade:
Collecting google-cloud
Collecting google-cloud-core>=0.20.0 (from google-cloud)
Using cached google_cloud_core-0.20.0-py2.py3-none-any.whl
Collecting google-cloud-language>=0.20.0 (from google-cloud)
Using cached google_cloud_language-0.20.0-py2.py3-none-any.whl
Collecting google-cloud-monitoring>=0.20.0 (from google-cloud)
Using cached google_cloud_monitoring-0.20.0-py2.py3-none-any.whl
Collecting google-cloud-storage>=0.20.0 (from google-cloud)
Using cached google_cloud_storage-0.20.0-py2.py3-none-any.whl
Collecting google-cloud-bigquery>=0.20.0 (from google-cloud)
Using cached google_cloud_bigquery-0.20.0-py2.py3-none-any.whl
Collecting google-cloud-error-reporting>=0.20.0 (from google-cloud)
Using cached google_cloud_error_reporting-0.20.0-py2.py3-none-any.whl
Collecting google-cloud-resource-manager>=0.20.0 (from google-cloud)
Using cached google_cloud_resource_manager-0.20.0-py2.py3-none-any.whl
Collecting google-cloud-vision>=0.20.0 (from google-cloud)
Using cached google_cloud_vision-0.20.0-py2.py3-none-any.whl
Collecting google-cloud-logging>=0.20.0 (from google-cloud)
Using cached google_cloud_logging-0.20.0-py2.py3-none-any.whl
Collecting google-cloud-translate>=0.20.0 (from google-cloud)
Using cached google_cloud_translate-0.20.0-py2.py3-none-any.whl
Collecting google-cloud-datastore>=0.20.0 (from google-cloud)
Using cached google_cloud_datastore-0.20.0-py2.py3-none-any.whl
Collecting google-cloud-dns>=0.20.0 (from google-cloud)
Using cached google_cloud_dns-0.20.0-py2.py3-none-any.whl
Collecting google-cloud-bigtable>=0.20.0 (from google-cloud)
Using cached google_cloud_bigtable-0.20.0-py2.py3-none-any.whl
Collecting google-cloud-pubsub>=0.20.0 (from google-cloud)
Using cached google_cloud_pubsub-0.20.0-py2.py3-none-any.whl
Collecting googleapis-common-protos>=1.3.4 (from google-cloud-core>=0.20.0->google-cloud)
Downloading googleapis-common-protos-1.3.4.tar.gz
Python 3.5.1 (v3.5.1:37a07cee5969, Dec 5 2015, 21:12:44)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from google.cloud import storage
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: cannot import name 'storage'
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 20 (7 by maintainers)
Had this weird problem where the
from google.cloud import storageline would work in the Python interpreter but would spit out this error while running within a file.Running
pip install --upgrade google-cloud-storagewas enough for it to be solved in my case. I guess it’s indeed a bug in pip.What’s very strange is that
pip freezeis identical.Not sure what we can do though. It’s likely a bug with
piporsetuptools. All we can do is recommend a cleanuninstall/ fresh environment.Uninstalling and doing a clean install did solve it.
Sure, though after my last comment I think it won’t be interesting 😃
Yes, that also failed – but I think I’ve got it – I had to uninstall both google-cloud and also protobuf, then let google-cloud reinstall protobuf.
Yay packaging! Try
pip show google-cloud-storage.googlepackages have you installed that may be hopping in front of your import?