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)

Most upvoted comments

Had this weird problem where the from google.cloud import storage line would work in the Python interpreter but would spit out this error while running within a file.

Running pip install --upgrade google-cloud-storage was 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 freeze is identical.

Not sure what we can do though. It’s likely a bug with pip or setuptools. All we can do is recommend a clean uninstall / fresh environment.

Uninstalling and doing a clean install did solve it.

Sure, though after my last comment I think it won’t be interesting 😃

---
Metadata-Version: 2.0
Name: google-cloud
Version: 0.20.0
Summary: API Client library for Google Cloud
Home-page: https://github.com/GoogleCloudPlatform/google-cloud-python
Author: Google Cloud Platform
Author-email: jjg+google-cloud-python@google.com
Installer: pip
License: Apache 2.0
Location: /Users/jlowin/anaconda3/lib/python3.5/site-packages
Requires: google-cloud-language, google-cloud-bigquery, google-cloud-bigtable, google-cloud-datastore, google-cloud-dns, google-cloud-resource-manager, google-cloud-logging, google-cloud-translate, google-cloud-vision, google-cloud-pubsub, google-cloud-storage, google-cloud-monitoring, google-cloud-core, google-cloud-error-reporting
Classifiers:
  Development Status :: 4 - Beta
  Intended Audience :: Developers
  License :: OSI Approved :: Apache Software License
  Operating System :: OS Independent
  Programming Language :: Python :: 2
  Programming Language :: Python :: 2.7
  Programming Language :: Python :: 3
  Programming Language :: Python :: 3.4
  Programming Language :: Python :: 3.5
  Topic :: Internet
---
Metadata-Version: 2.0
Name: google-cloud-datastore
Version: 0.20.0
Summary: Python Client for Google Cloud Datastore
Home-page: https://github.com/GoogleCloudPlatform/google-cloud-python
Author: Google Cloud Platform
Author-email: jjg+google-cloud-python@google.com
Installer: pip
License: Apache 2.0
Location: /Users/jlowin/anaconda3/lib/python3.5/site-packages
Requires: google-cloud-core, grpcio
Classifiers:
  Development Status :: 4 - Beta
  Intended Audience :: Developers
  License :: OSI Approved :: Apache Software License
  Operating System :: OS Independent
  Programming Language :: Python :: 2
  Programming Language :: Python :: 2.7
  Programming Language :: Python :: 3
  Programming Language :: Python :: 3.4
  Programming Language :: Python :: 3.5
  Topic :: Internet

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.

  1. What command did you use to install?
  2. What other google packages have you installed that may be hopping in front of your import?