GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — google-cloud 0.20.0 'from google.cloud import storage' not working · Issue #2464 · googleapis/google-cloud-python

google-cloud 0.20.0 'from google.cloud import storage' not working #2464

New issue
Copy link
New issue
Copy link
Closed
Closed
google-cloud 0.20.0 'from google.cloud import storage' not working#2464
Copy link
Assignees
VelizarVESSELINOV
Labels
packaging

Description

@VelizarVESSELINOV
VelizarVESSELINOV
opened on Sep 29, 2016
Issue body actions

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'

Activity

  1. VelizarVESSELINOV
    changed the title [-]google-cloud 0.20.0 from google.cloud import storage not working[/-] [+]google-cloud 0.20.0 'from google.cloud import storage' not working[/+] on Sep 29, 2016
  2. dhermes commented on Sep 29, 2016

    @dhermes
    dhermes
    on Sep 29, 2016
    Contributor
    More actions

    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?
    Reacted by Mona Jalal
  3. dhermes
    added
    packaging
    on Sep 29, 2016
  4. VelizarVESSELINOV commented on Sep 29, 2016

    @VelizarVESSELINOV
    VelizarVESSELINOV
    on Sep 29, 2016
    Author
    More actions

    I moved today from 0.19.0 to 0.20.0 using pip install -r requirements.txt

    after removing the virtual env and recreating again without update, it is working.

  5. VelizarVESSELINOV
    closed this as completedon Sep 29, 2016
  6. dhermes commented on Sep 29, 2016

    @dhermes
    dhermes
    on Sep 29, 2016
    Contributor
    More actions

    Great news! Thanks

  7. jlowin commented on Oct 4, 2016

    @jlowin
    jlowin
    on Oct 4, 2016
    More actions

    I also just upgraded from 0.19 to 0.20 with pip install --upgrade google-cloud and now can't import anything:

    In [2]: from google.cloud import datastore
    ---------------------------------------------------------------------------
    ImportError                               Traceback (most recent call last)
    <ipython-input-2-46f71c99c111> in <module>()
    ----> 1 from google.cloud import datastore
    
    ImportError: cannot import name 'datastore'
    

    Uninstall/reinstall had no effect.

  8. daspecster commented on Oct 4, 2016

    @daspecster
    daspecster
    on Oct 4, 2016
    Contributor
    More actions

    @jlowin, since switching to namespace packages, you'll note in our CONTRIBUTING.rst that importing may not work as expected.

    @dhermes, are there any workarounds so our examples work in the CLI REPL?

  9. jlowin commented on Oct 4, 2016

    @jlowin
    jlowin
    on Oct 4, 2016
    More actions

    @daspecster I used the same import statement in 0.19 without issue (from google.cloud import datastore)

  10. daspecster commented on Oct 4, 2016

    @daspecster
    daspecster
    on Oct 4, 2016
    Contributor
    More actions

    @jlowin, if you put from google.cloud import datastore in a test_datastore.py file and run it with python test_datastore.py, does that also fail?

  11. jlowin commented on Oct 4, 2016

    @jlowin
    jlowin
    on Oct 4, 2016
    More actions

    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.

    Reacted by Tautvydas Misiunas
  12. dhermes commented on Oct 4, 2016

    @dhermes
    dhermes
    on Oct 4, 2016
    Contributor
    More actions

    @jlowin Can you do pip show google-cloud google-cloud-datastore?

  13. jlowin commented on Oct 4, 2016

    @jlowin
    jlowin
    on Oct 4, 2016
    More actions

    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: [email protected]
    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: [email protected]
    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
    
    Reacted by Danny Hermes
  14. jlowin commented on Oct 4, 2016

    @jlowin
    jlowin
    on Oct 4, 2016
    More actions

    Ok, I can create this error deterministically (on my machine at least):

    pip uninstall google-cloud
    pip install "google-cloud==0.19"
    pip install google-cloud --upgrade
    python -c "from google.cloud import datastore"
    

    result:

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
    ImportError: cannot import name 'datastore'
    
  15. dhermes commented on Oct 4, 2016

    @dhermes
    dhermes
    on Oct 4, 2016
    Contributor
    More actions

    Indeed.

    $ virtualenv venv
    $ source venv/bin/activate
    (venv) $ venv/bin/pip install "google-cloud==0.19"
    Collecting google-cloud==0.19
    ...
    (venv) $ venv/bin/python -c "from google.cloud import datastore"
    (venv) $ echo ${?}
    0
    (venv) $ venv/bin/pip install --upgrade google-cloud
    Collecting google-cloud
    ...
    (venv) $ venv/bin/python -c "from google.cloud import datastore"
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
    ImportError: cannot import name datastore
    (venv) $ venv/bin/pip freeze
    enum34==1.1.6
    future==0.15.2
    futures==3.0.5
    gapic-google-logging-v2==0.10.1
    gapic-google-pubsub-v1==0.10.1
    google-cloud==0.20.0
    google-cloud-bigquery==0.20.0
    google-cloud-bigtable==0.20.0
    google-cloud-core==0.20.0
    google-cloud-datastore==0.20.0
    google-cloud-dns==0.20.0
    google-cloud-error-reporting==0.20.0
    google-cloud-language==0.20.0
    google-cloud-logging==0.20.0
    google-cloud-monitoring==0.20.0
    google-cloud-pubsub==0.20.0
    google-cloud-resource-manager==0.20.0
    google-cloud-storage==0.20.0
    google-cloud-translate==0.20.0
    google-cloud-vision==0.20.0
    google-gax==0.14.1
    googleapis-common-protos==1.3.5
    grpc-google-iam-v1==0.10.1
    grpc-google-logging-v2==0.10.1
    grpc-google-pubsub-v1==0.10.1
    grpcio==1.0.0
    httplib2==0.9.2
    oauth2client==3.0.0
    ply==3.8
    protobuf==3.1.0.post1
    pyasn1==0.1.9
    pyasn1-modules==0.0.8
    rsa==3.4.2
    six==1.10.0
    

    whereas installed just fresh

    $ virtualenv venv
    $ source venv/bin/activate
    (venv) $ venv/bin/pip install --upgrade google-cloud
    Collecting google-cloud
    ...
    (venv) $ venv/bin/python -c "from google.cloud import datastore"
    (venv) $ echo ${?}
    0
    (venv) $ venv/bin/pip freeze
    enum34==1.1.6
    future==0.15.2
    futures==3.0.5
    gapic-google-logging-v2==0.10.1
    gapic-google-pubsub-v1==0.10.1
    google-cloud==0.20.0
    google-cloud-bigquery==0.20.0
    google-cloud-bigtable==0.20.0
    google-cloud-core==0.20.0
    google-cloud-datastore==0.20.0
    google-cloud-dns==0.20.0
    google-cloud-error-reporting==0.20.0
    google-cloud-language==0.20.0
    google-cloud-logging==0.20.0
    google-cloud-monitoring==0.20.0
    google-cloud-pubsub==0.20.0
    google-cloud-resource-manager==0.20.0
    google-cloud-storage==0.20.0
    google-cloud-translate==0.20.0
    google-cloud-vision==0.20.0
    google-gax==0.14.1
    googleapis-common-protos==1.3.5
    grpc-google-iam-v1==0.10.1
    grpc-google-logging-v2==0.10.1
    grpc-google-pubsub-v1==0.10.1
    grpcio==1.0.0
    httplib2==0.9.2
    oauth2client==3.0.0
    ply==3.8
    protobuf==3.1.0.post1
    pyasn1==0.1.9
    pyasn1-modules==0.0.8
    rsa==3.4.2
    six==1.10.0
    
  16. dhermes commented on Oct 4, 2016

    @dhermes
    dhermes
    on Oct 4, 2016
    Contributor
    More actions

    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.

    Reacted by Roman Hartmann and Praveen Kumar
  17. jlowin commented on Oct 4, 2016

    @jlowin
    jlowin
    on Oct 4, 2016
    More actions

    bizarre and you're right, maybe nothing you can do! I'd at least recommend adding that note about the 0.19 -> 0.20 upgrade path to README though, I bet a lot of people will get bitten just through normal requirements.txt dependency installation! For what it's worth I continued the conversation at #2493 (comment) with the steps that resolved this for me.

  18. listentojohan commented on Feb 7, 2018

    @listentojohan
    listentojohan
    on Feb 7, 2018
    More actions

    I just encountered the same problem, but have had it working before.

    Version: 1.2.0
    Summary: Python Client for Google Cloud Storage
    Home-page: https://github.com/GoogleCloudPlatform/google-cloud-python
    Author: Google Cloud Platform
    Author-email: [email protected]
    License: Apache 2.0
    Location: /usr/local/lib/python3.6/site-packages
    Requires: google-resumable-media, google-auth, requests, google-cloud-core```
    
  19. listentojohan commented on Feb 7, 2018

    @listentojohan
    listentojohan
    on Feb 7, 2018
    More actions

    Uninstalling and doing a clean install did solve it.

    Reacted by Thomas Schultz
  20. listentojohan commented on Apr 3, 2018

    @listentojohan
    listentojohan
    on Apr 3, 2018
    More actions

    I am however now experiencing the same with a python:2 docker image using google.cloud storage.
    Getting:
    ImportError: Google Cloud Storage I/O not supported for this execution environment (could not import storage API client).

  21. VelizarVESSELINOV commented on Apr 20, 2018

    @VelizarVESSELINOV
    VelizarVESSELINOV
    on Apr 20, 2018
    Author
    More actions

    Again after updating google-storage-cloud the package didn't work due to residual google packages with mismatch dependency.

    Needed to delete all the old packages that pip3 uninstall google-cloud was ignoring using:
    pip3 list | grep google | awk '{print $1}' | xargs pip uninstall -y

    Hopefully one day Google will master pip or improve pip system.

  22. Ieshu commented on Jul 17, 2020

    @Ieshu
    Ieshu
    on Jul 17, 2020
    More actions

    from google.cloud import bigtable

    gives this error-->

    ImportError: cannot import name 'init_grpc_aio' from 'grpc._cython.cygrpc' (C:\Users\PYTHON\lib\site-packages\grpc_cython\cygrpc.cp37-win_amd64.pyd)

  23. Lavedonio commented on Oct 1, 2020

    @Lavedonio
    Lavedonio
    on Oct 1, 2020
    More actions

    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.

    Reacted by Arjit Katare, jyotsnakanikella and kangear
  24. JustinBeckwith
    assigned
    VelizarVESSELINOV
    on Feb 1, 2021
  25. parthea
    added a commit that references this issue on Nov 24, 2025

    fix: bump the minimum version of google-apps-card to 0.3.0 (#2464)

    c0d8783
  26. parthea
    added 2 commits that reference this issue on Apr 1, 2026

    docs: Move readme content to new User Guide section (#2464)

    5b143c3

    chore: librarian release pull request: 20260303T181914Z (#2489)

    72b1c96
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @VelizarVESSELINOV
    VelizarVESSELINOV

Labels

packaging

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.