question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ImportError: No module named google.cloud.storage

See original GitHub issue

I have read and implemented several solution to fix this issue on my local machine, and all resulted in the same error response. Now I am executing my code in GOOGLE CLOUD SHELL, which is suppose to have google-cloud pre-install, yet I am still receiving the same errors. PLEASE HELP!!!

python version - python2.7

this is the import script

from google.cloud import storage

this is the traceback error

Traceback (most recent call last):
  File "/google/google-cloud-sdk/platform/google_appengine/google/appengine/runtime/wsgi.py", line 240, in Handle
    handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
  File "/google/google-cloud-sdk/platform/google_appengine/google/appengine/runtime/wsgi.py", line 299, in _LoadHandler
    handler, path, err = LoadObject(self._handler)
  File "/google/google-cloud-sdk/platform/google_appengine/google/appengine/runtime/wsgi.py", line 85, in LoadObject
    obj = __import__(path[0])
  File "/home/mitchkojelegance/lekoj/main.py", line 3, in <module>
    from google.cloud import storage
  File "/google/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/python/runtime/sandbox.py", line 1148, in load_module
    raise ImportError('No module named %s' % fullname)
ImportError: No module named google.cloud.storage

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

31reactions
tseavercommented, May 16, 2018

@le-koj You need to install google-cloud-storage into your Python environment:

$ pip install google-cloud-storage
9reactions
KnudY9commented, Oct 5, 2019

I tried all command below but it DIDNT work it.

env linux centos7 python3.6.8

pip install google-cloud-storage
pip3  install google-cloud-storage
pip3  install --user google-cloud-storage

target code

from google.cloud import speech_v1 as speech
or
from google.cloud import speech

error from google.cloud import storage ImportError: No module named google.cloud

Requirement already satisfied: google-cloud-storage in /home/django/.local/lib/python3.6/site-packages (1.18.0)
Requirement already satisfied: google-auth>=1.2.0 in /usr/local/lib/python3.6/site-packages (from google-cloud-storage) (1.6.3)
Requirement already satisfied: google-cloud-core<2.0dev,>=1.0.0 in /usr/local/lib/python3.6/site-packages (from google-cloud-storage) (1.0.3)
Requirement already satisfied: google-resumable-media>=0.3.1 in /usr/local/lib/python3.6/site-packages (from google-cloud-storage) (0.3.3)
Requirement already satisfied: cachetools>=2.0.0 in /usr/local/lib/python3.6/site-packages (from google-auth>=1.2.0->google-cloud-storage) (3.1.1)
Requirement already satisfied: rsa>=3.1.4 in /usr/local/lib/python3.6/site-packages (from google-auth>=1.2.0->google-cloud-storage) (4.0)
Requirement already satisfied: six>=1.9.0 in /usr/local/lib/python3.6/site-packages (from google-auth>=1.2.0->google-cloud-storage) (1.12.0)
Requirement already satisfied: pyasn1-modules>=0.2.1 in /usr/local/lib/python3.6/site-packages (from google-auth>=1.2.0->google-cloud-storage) (0.2.6)
Requirement already satisfied: google-api-core<2.0.0dev,>=1.14.0 in /usr/local/lib/python3.6/site-packages (from google-cloud-core<2.0dev,>=1.0.0->google-cloud-storage) (1.14.2)
Requirement already satisfied: pyasn1>=0.1.3 in /usr/local/lib/python3.6/site-packages (from rsa>=3.1.4->google-auth>=1.2.0->google-cloud-storage) (0.4.7)
Requirement already satisfied: pytz in /home/django/.local/lib/python3.6/site-packages (from google-api-core<2.0.0dev,>=1.14.0->google-cloud-core<2.0dev,>=1.0.0->google-cloud-storage) (2018.3)
Requirement already satisfied: protobuf>=3.4.0 in /usr/local/lib64/python3.6/site-packages (from google-api-core<2.0.0dev,>=1.14.0->google-cloud-core<2.0dev,>=1.0.0->google-cloud-storage) (3.9.1)
Requirement already satisfied: requests<3.0.0dev,>=2.18.0 in /usr/local/lib/python3.6/site-packages (from google-api-core<2.0.0dev,>=1.14.0->google-cloud-core<2.0dev,>=1.0.0->google-cloud-storage) (2.22.0)
Requirement already satisfied: googleapis-common-protos<2.0dev,>=1.6.0 in /usr/local/lib/python3.6/site-packages (from google-api-core<2.0.0dev,>=1.14.0->google-cloud-core<2.0dev,>=1.0.0->google-cloud-storage) (1.6.0)
Requirement already satisfied: setuptools>=34.0.0 in /usr/local/lib/python3.6/site-packages (from google-api-core<2.0.0dev,>=1.14.0->google-cloud-core<2.0dev,>=1.0.0->google-cloud-storage) (41.2.0)
Requirement already satisfied: idna<2.9,>=2.5 in /usr/local/lib/python3.6/site-packages (from requests<3.0.0dev,>=2.18.0->google-api-core<2.0.0dev,>=1.14.0->google-cloud-core<2.0dev,>=1.0.0->google-cloud-storage) (2.8)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.6/site-packages (from requests<3.0.0dev,>=2.18.0->google-api-core<2.0.0dev,>=1.14.0->google-cloud-core<2.0dev,>=1.0.0->google-cloud-storage) (2019.9.11)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /usr/local/lib/python3.6/site-packages (from requests<3.0.0dev,>=2.18.0->google-api-core<2.0.0dev,>=1.14.0->google-cloud-core<2.0dev,>=1.0.0->google-cloud-storage) (3.0.4)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /usr/local/lib/python3.6/site-packages (from requests<3.0.0dev,>=2.18.0->google-api-core<2.0.0dev,>=1.14.0->google-cloud-core<2.0dev,>=1.0.0->google-cloud-storage) (1.25.3)
Read more comments on GitHub >

github_iconTop Results From Across the Web

ImportError: No module named google.cloud - Stack Overflow
I used sudo python -m pip install google-cloud instead and it worked.
Read more >
No module named 'google-cloud-storage' – Finxter
Quick Fix: Python raises the ImportError: No module named 'google-cloud-storage' when it cannot find the library google-cloud-storage .
Read more >
How To Solve This Error: Importerror: No Module Named ...
When you get the ImportError: No module named 'google' error, it means that your Python installation doesn't have the Google Cloud Library ...
Read more >
ImportError: No module named cloud : Forums
ImportError : No module named cloud ... some file that you happen to have in your storage called google.py ):. import google print(google....
Read more >
PYTHON : ImportError: No module named 'google' - YouTube
PYTHON : ImportError : No module named ' google ' [ Gift : Animated Search Engine : https://bit.ly/AnimSearch ] PYTHON : ImportError: No...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found