[conda] No module named 'nbdev'

Continuing the discussion from Nbdev discussion:

Hi @nextM,

I had the same issue as you described. I generated the nbdev-environment from within JupyterLab console. Apparently it set up the notebooks (00_core.ipynb, index.pynb) in the default environment. I had to simply change the notebooks environment where I installed nbdev:

image

So no need for ln -s .

1 Like

Hi Johannes,

I’m stuck in a situation where nbdev_test_nbs and nbdev_build_docs constantly run into ModuleNotFoundError (No module named ‘nbdev’). In my opinion it has to do with an anaconda installation, jupyter and ipykernels. Leading to very curious results. For example if (in a new terminal window) I clone fastscript repository, cd into it and run the following commands in this order, I only get the ModuleNotFoundError at the nbdev_test_nbs and the 2nd time I call nbdev_build_docs:

nbdev_build_lib
nbdev_build_docs [no errors here]
nbdev_test_nbs [first time ModuleNotFoundError occurs]
nbdev_build_docs [suddenly I get the same ModuleNotFoundError as nbdev_test_nbs]

Somehow the nbdev commands use the ipykernels that are stored with the ipynb files. I don’t fully understand (and don’t know how to find out) how these things interact with one another. Running python on the command line in the folder I can easily import from nbdev.

Another peculiar thing I observed: There seems to be some additional state stored somewhere in the (command line) environment. If I delete the fastscript directory, clone the repo again and run the above mentioned commands I get an error already after the second command:
nbdev_build_lib
nbdev_build_docs [now ModuleNotFoundError for nbdev occurs here already]

Hi Daniel,

I just run the tutorial again. It work’s fine for me as long as I’m choosing the right environment for the notebooks and the terminal.
I’m working in JupyterLab in a Docker Container. You can find my Docker configuration here:

1 Like

Johannes, thank you. I will do and report afterwards :smiley:

Now with your Docker container it does work for me as well :smiley:Thanks again!

I did run into some issues with the docker command from your README.md and had to build the container a second time as I’m not familiar with Docker (I rarely use it). The slight modification that worked for me was this:
docker build . -t joatom/ml
(the dot was missing; I replaced the value of the -t option as well).

Now all the commands are running smoothly:

Great to hear that it worked for you. Thanks for the dot-hint. I’ll add it to the README.

1 Like