0

I mounted the drive in google collab as follows -

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

And I changed the working directory to where my code is

import os
os.chdir('/content/gdrive/My Drive/Mutual-Channel-Loss-Collab')
print(os.getcwd())
print(os.listdir())

/content/gdrive/My Drive/Mutual-Channel-Loss-Collab
['CUB_200_2011', 'CUB-200-2011.ipynb', 'my_pooling.ipynb']

I am running 'CUB-200-2011.ipynb' and importing 'my_pooling.ipynb' eventhough both are in the same directory, I get the error ModuleNotFoundError: No module named 'my_pooling'

r4bb1t
  • 1,033
  • 2
  • 13
  • 36
  • 1
    `my_pooling.ipynb` is not module but `notebook` file. Module means pure Python code in file with extension `.py`. And you can import only `my_pooling.py` – furas Jun 19 '20 at 23:48
  • 1
    [ipynb import another ipynb file](https://stackoverflow.com/questions/20186344/ipynb-import-another-ipynb-file) - it needs something more then only standard `import` – furas Jun 20 '20 at 00:21

0 Answers0