Python is one of the best languages for interacting with the Google Cloud Platform, giving developers access to a wide range of Google services. However, some users have reported that when trying to import a Google Cloud module into their program, they encountered the error “No module named ‘google.cloud'” in Python. So, we will show you how to fix this annoying error in this article quickly.
What is Google Cloud Platform?
Google Cloud Platform (GCP) is a cloud computing service that provides users with various tools and services for computing, storage, networking, and big data.
Businesses can scale applications quickly and easily with GCP, pay only for what they use, and gain access to Google’s world-class infrastructure.
When does the error “No module named ‘google.cloud'” in Python occur?
This error occurs because you have not installed the Google Cloud service required. Specifically, this error will appear if you try to run a Python program that uses one of the Google Cloud services without first installing it on your computer. To understand the root of this error, look at the examples below.
# Want to use Google Cloud Storage but haven't installed it yet from google.cloud import storage # Try to use Google Cloud Storage print(storage.__version__)
Error:
No module named google.cloud
# Want to use Google Cloud Speech but haven't installed it yet from google.cloud import speech # Try to use Google Cloud Speech print(speech.__version__)
Error:
No module named google.cloud
As you can see, in the above two examples, we attempted to utilize the Google Cloud Storage and Google Cloud Speech services, but we did not actually install them. As a result, we get the same error.
How to fix this error?
Install Google Cloud Service before using
Like other Python modules, before using a module in your application, you must successfully install it. One of the quickest and simplest methods is to use pip to install modules. Please install the pip before continuing to read the article.
Below is installation instruction for Google Cloud Storage. You can use this instruction for other services.
To install Google Cloud Storage, open a terminal window and type the following command:
pip install google-cloud-storage
For Python 3 on Linux or macOS:
pip3 install google-cloud-storage
If the message “Successfully installed google-cloud-storage
” appears, the service has been successfully installed. Now, you can use it faultlessly.
# Installed Google Cloud Storage module from google.cloud import storage # Try to use Google Cloud Storage print('Google Cloud Storage version:', storage.__version__)
Output:
Google Cloud Storage version: 2.6.0
Uninstall and reinstall Google Cloud services
Google-cloud module is no longer supported as of June 18, 2018. As a result, “pip install google-cloud
” is no longer used. If you previously installed Google Cloud with that command, you should uninstall it by using the following command:
pip uninstall google-cloud
Next, let’s install the Google Cloud service you need. For instance, since we need to use Google Cloud Storage, we will install it using the command:
pip install google-cloud-storage
If the message “Successfully installed google-cloud-storage
” appears. It means the Google Cloud Storage service has been successfully installed.
You can use this way with other Google Cloud services; just make sure to install the ones you need.
Summary
In summary, if you see the “No module named google.cloud” error when trying to use Python with the Google Cloud Platform, don’t be worried; just make sure you have the required Google Cloud services installed before using it, and this error will be resolved quickly. We hope the instructions in this post helped you in fixing this error. If you have any questions, please leave them in the comment section below.
Thank you for reading!
Maybe you are interested:
- ModuleNotFoundError: No module named ‘Cython’ in Python
- ModuleNotFoundError: No module named ‘PyQt5’ in Python
- ModuleNotFoundError: No module named ‘pandas’ in Python

Hi, I’m Cora Lopez. I have a passion for teaching programming languages such as Python, Java, Php, Javascript … I’m creating the free python course online. I hope this helps you in your learning journey.
Name of the university: HCMUE
Major: IT
Programming Languages: HTML/CSS/Javascript, PHP/sql/laravel, Python, Java