0

I'm using python 3.9.1 and I'm trying to use the google api in my script.

When I run the script it complains that it can't find the google module:

    python .\gcp_list_buckets.py
    Traceback (most recent call last):
      File "C:\Users\bluet\OneDrive\Desktop\important_folders\project\git\cloud_scripts\gcp_scripts\python\gcp_list_buckets.py", line 1, in <module>
        from google.cloud import storage
    ModuleNotFoundError: No module named 'google'

I'm working in a virtual env and I installed the google module before running it:

$ pip show google
Name: google
Version: 3.0.0
Summary: Python bindings to the Google search engine.
Home-page: http://breakingcode.wordpress.com/
Author: Mario Vilas
Author-email: [email protected]
License: UNKNOWN
Location: c:\users\bluet\onedrive\desktop\important_folders\project\git\cloud_scripts\gcp_scripts\python\venv\lib\site-packages
Requires: beautifulsoup4
Required-by:

This is my import statement in my script:

from google.cloud import storage

Why am I getting this error and how do I get past this?

2
  • 1
    I don't think you have the package installed. Installing the module google doesnt bring in absolutely everything available. The package you have installed isn't even an official google package. Try pip install google-cloud-storage. Then run it again. Commented Feb 9, 2021 at 21:42
  • Thanks that did it. If you put that as the answer I'll accept it. Commented Feb 9, 2021 at 21:48

1 Answer 1

1

You don't have the right package installed. You need the google-cloud-storage package.

pip install google-cloud-storage
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.