Error with nbdev.export.nb_export

Hi everyone,

I’ve just started the course on Practical Deep Learning, and I’m trying to follow and do the end-to-end process described in lesson 2.

However, when I use the code described here and here as follows:

import nbdev
nbdev.export.nb_export('app.ipynb', 'app')
print('Export successful')

I get the following error:

FileNotFoundError                         Traceback (most recent call last)
<ipython-input-16-2ee21780eaf6> in <module>
      1 import nbdev
----> 2 nbdev.export.nb_export('app.ipynb')
      3 print('Export successful')

6 frames
/usr/lib/python3.7/ in _opener(self, name, flags, mode)
   1061     def _opener(self, name, flags, mode=0o666):
   1062         # A stub for the opener argument to built-in open()
-> 1063         return, flags, mode)
   1065     def _raw_open(self, flags, mode=0o777):

FileNotFoundError: [Errno 2] No such file or directory: 'app.ipynb'

Any idea on how to solve it or figure out what’s happening? I’m really new into these topics, but I’ve been trying to search in the forums and so on, but I can’t find any solution to it.

For what I think I understand of the error message, it’s looking for ‘app.ipynb’. However, the code should be exporting it, therefore it’s normal that it doesn’t exists already. I’m so confused.

Any help is appreciated! :slight_smile:

Seems like you didn’t mention the path where you want to import (after the .ipynb file in the function.

Few checkpoints:

  • Make sure your NB name matches with what you are passing inside the function.

  • Make sure a valid path is set and passed as well.

1 Like