Nbdev Module Error in getting started

Hey everyone,
I tried starting with nbdev using the Tutorial guide in the docs.
I could go through all the steps as instructed until this step.
Edit 00_core.ipynb

After I made some simple changes and did restart and run all cells;
I’m getting this error:

ModuleNotFoundError                       Traceback (most recent call last)
Cell In[4], line 2
      1 #| hide
----> 2 from nbdev.showdoc import *

ModuleNotFoundError: No module named 'nbdev'

Even though I successfully ran all the nbdev commands until now.

I tried running !pip install nbdev in the previous cell but got the same error.

How may I resolve this issue?

Did you try restarting the notebook after running !pip install nbdev?

2 Likes

(The particular notebook) Yes, multiple times but the same result.
But I haven’t tried restarting the project since then, maybe I should check again.

Also, is there a way to check whether nbdev was installed correctly locally?

You can use pip show nbdev

2 Likes

The issue you’re having could also be because either the environment isn’t activated, or the notebook is being run in a different environment.

1 Like

Hey, everyone

Thanks for the replies and suggestion but it seems to be a JupyterLab issue rather than a nbdev issue.
I have opened a topic for this in Jupyter Community Forum here: Jupyter lab notebook No Module Named error upon importing installed packages

As I said earlier, the nbdev commands were working fine in terminal but causing issue when imported in the notebook.

Now again as I was working with fastai for a different project I got the same error, even though the package was installed both locally and the virtual environment.

I got similar error when importing torch, keras as well. but packages such as pandas, numpy worked fine.

One thing I’d like to add is, up till now I have been using fastai, pytorch etc. through colab or kaggle notebook;

Is there a difference in importing them in local notebook?