Running `nbdev_test_nbs` locally throws ModuleNotFoundError

the command nbdev_test_nbs fails when I run it locally.
I have updated setttings.ini with the required packages and CI on github seems to pass when this test command is run.

Only difference locally: i’m running inside a virtualenv where all the packages comes from
pip install -e .

FYI here is the stack trace:

------------------------------------------------------------------------
ModuleNotFoundError                    Traceback (most recent call last)
<ipython-input-3-7989c25f70ec> in <module>
      1 #export
----> 2 from nbdev.showdoc import *
      3 from temp_nbdev.imports import *
      4 import numpy as np
      5 from IPython.display import display,SVG

ModuleNotFoundError: No module named 'nbdev'
ModuleNotFoundError: No module named 'nbdev'

Traceback (most recent call last):
  File "/Users/js/temp_nbdev/venv-temp/bin/nbdev_test_nbs", line 8, in <module>
    sys.exit(nbdev_test_nbs())
  File "/Users/js/temp_nbdev/venv-temp/lib/python3.7/site-packages/fastscript/core.py", line 73, in _f
    func(**args.__dict__)
  File "/Users/js/temp_nbdev/venv-temp/lib/python3.7/site-packages/nbdev/cli.py", line 70, in nbdev_test_nbs
    raise Exception(msg + '\n'.join([f.name for p,f in zip(passed,files) if not p]))

This may be obvious but is nbdev installed in the virtual environment? (IE pip show nbdev shows something)

yes it is.
nbdev and all the packages specified in the settings.ini show up as expected.

I traced the issue: it’s failing because the Jupyter notebook was on the wrong kernel. I just changed Jupyter to point to the right kernel and nbdev_test_nbs worked as expected.

1 Like