error in importing a .ipynb file in jupyter note book

Viewed 435

haii i am trying to import a .ipynb as a module in google colab so i installed libarary and tried to import ipynb file but i am getting error

can some body tell me how to resolve this error

 !pip install import_ipynb
 import import_ipynb
 import /content/drive/MyDrive/CSRNet-pytorch/make_dataset.ipynb

for which i got the error

 File "<ipython-input-11-7fb3bfd02505>", line 2
    import /content/drive/MyDrive/CSRNet-pytorch/make_dataset.ipynb
       ^
 SyntaxError: invalid syntax
1 Answers

first move to the dir where the notebook to import is contained with:

%cd /path/to/notebook

and then:

import notebook.ipynb
Related