[Solved] How to resolve: ModuleNotFoundError: No module named ‘google.colab’

I want to run the command:

from google.colab import auth

But I am getting this error:

ModuleNotFoundError: No module named ‘google.colab’

This is required for accessing files on google drive from python. There is a package google but not module colab in it. How to resolve this error?

Solution #1:

You can simply download google-colab and use it in local.

pip install google-colab
Respondent: Ravaging Care
Solution #2:

AFAIK, you can execute the module ‘google.colab’ from within the notebook environment of (it is not a publicly available package)

Looking at the tag conda in your question. I assume that you are running the code from your local machine.

Please make use of PyDrive to read from google drive on your local machine.


  1. Google Colaboratory FAQ
  2. PyDrive
Respondent: Hazeeb M
Solution #3:


You can use ! install to do that.

Colab is just like a Jupyter notebook. Therefore, we can use the ! operator here to install any package in Colab. What ! actually does is, it tells the notebook cell that this line is not a Python code, its a command line script. So, to run any command line script in Colab, just add a ! preceding the line.

For example: !pip install tensorflow. This will treat that line (here pip install tensorflow) as a command prompt line and not some Python code. However, if you do this without adding the ! preceding the line, it’ll throw up an error saying “invalid syntax”.

But keep in mind that you’ll have to upload the file to your drive before doing this (preferably into the same folder where your notebook is).

Hope this answers your question

Respondent: Dhruvan Ganesh
The answers/resolutions are collected from stackoverflow, are licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0 .

Most Popular

To Top
India and Pakistan’s steroid-soaked rhetoric over Kashmir will come back to haunt them both clenbuterol australia bossier man pleads guilty for leadership role in anabolic steriod distribution conspiracy