Ravaging Care
Ravaging Care

Reputation: 912

How to resolve ModuleNotFoundError: No module named 'google.colab'

When I run:

from google.colab import auth

I get this error:

ModuleNotFoundError: No module named 'google.colab'

This module is required for accessing files on Google drive from python. How can I resolve this error?

Upvotes: 50

Views: 201064

Answers (3)

Sheila
Sheila

Reputation: 161

If you want to run google-colab from your local machine and you want to install if via conda, just type the following:

conda install -c conda-forge google-colab

For reference: https://anaconda.org/conda-forge/google-colab

Upvotes: 16

Dhruvan Ganesh
Dhruvan Ganesh

Reputation: 1560

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

OFF-TOPIC: 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.

References:

  1. Google Colaboratory FAQ
  2. PyDrive

Upvotes: 9

Hazeeb M
Hazeeb M

Reputation: 599

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

pip install google-colab

Upvotes: 55

Related Questions