While .py files placed in the same folder at Google Colab I get:
ModuleNotFoundError: No module named filename
Although the 'filename' file is in the same folder and imported by:
from filename import *
Thanks in advance
Update your Google Chrome version to >=80 and it works perfectly! Show activity on this post. an internet connection problem: so check your internet connection first, or try opening other sites.
Installing a Python package in Google Colab is simple using the pip command along with the exclamation mark (!). The exclamation mark at the start of a cell allows to run a shell command, and pip is the Python package installer that allows to install Python libraries.
To import google drive, write this code in code section of colab and run it by Ctrl+Enter . On running code, one blue link and a text box will appear we need to provide a permission text. So click the link and a new tab will open where you will be asked for permission to access google drive.
Your file layout in Drive is distinct from the file layout in Colab.
In order to use Drive files in Colab, you'll need to mount your Drive on the Colab backend using the following snippet:
from google.colab import drive
drive.mount('/content/drive')
Then, if you have a file like mylib.py
, you'll want to %cd /content/drive
in order to change your working directory. Then, you can import mylib
.
Here's a complete example:
https://colab.research.google.com/drive/12qC2abKAIAlUM_jNAokGlooKY-idbSxi
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With