0

I am trying to import an .ipynb file from another directory.

After trying:

import sys
sys.path.append("../TheOtherFolder")
print(sys.path)

I can see that the required path is added in the "sys.path" successfully.

After trying to import the .ipynb file:

import import_ipynb
import test    #this is a .ipynb file

Unfortunately, I still get "ModuleNotFoundError: No module named 'test'"

  • This should answer you question [import function from other notebook](https://stackoverflow.com/questions/44116194/import-a-function-from-another-ipynb-file). Indeed, importing from a notebook is different from importing from a python file. However, I would suggest you copy whatever code you need from the other notebook into a python file. This will be much cleaner for import. – Ssayan Mar 02 '22 at 10:45

0 Answers0