I'm using Google Colab and I want to import a file from the same directory.
I've mounted my Drive:
from google.colab import drive
drive.mount('/content/drive')
And then done:
import sys
sys.path.insert(0, '/content/drive/MyDrive/NLP/Exam')
However when I do
import funct as fu
It throws the following error:
ModuleNotFoundError: No module named 'funct'
Despite the fact that funct.py
is in this directory. What could I be missing?
print(os.listdir(sys.path[0]))
to prove that it has what you think it has?No such file or directory: '/MyDrive/NLP/Exam'
ls
there is thefunct.py
file.