Answers for "import file in colabs"

1

colab import python file

# In case anyone else is interested to know how to import files/packages 
# from gdrive inside a google colab. The following procedure worked for 
# me:

# 1) Mount your google drive in google colab:

from google.colab import drive
drive.mount('/content/gdrive/')

# 2) Append the directory to your python path using sys:

import sys
sys.path.append('/content/gdrive/mypythondirectory')

# Now you should be able to import stuff from that directory!
Posted by: Guest on April-08-2021
0

import file in colabs

from google.colab import drive

drive.mount(‘/content/drive’)
Posted by: Guest on June-12-2021

Browse Popular Code Answers by Language