Fastbook Installation Problem On Local PC

I am running in my local PC and I am trying to install fastai and fastbook to run the notebooks

I am running the follwing command:

conda install -c fastai -c pytorch fastai fastbook

It finished.
then when running the import in the notebook

import fastbook

I am getting the following error:

NameError Traceback (most recent call last)
1 #hide
2 # !pip install -Uqq fastbook
----> 3 import fastbook
4 fastbook.setup_book()

~/anaconda3/envs/fastai/lib/python3.8/site-packages/fastbook/ in
15 except ModuleNotFoundError:
16 warn("Missing Azure SDK - please run pip install azure-cognitiveservices-search-imagesearch")
—> 17 try: from nbdev.showdoc import *
18 except ModuleNotFoundError: warn(“Missing nbdev - please install it”)
19 try:

~/anaconda3/envs/fastai/lib/python3.8/site-packages/nbdev/ in
6 from .flags import *
----> 7 from .showdoc import show_doc
8 #from .export import notebook2script

~/anaconda3/envs/fastai/lib/python3.8/site-packages/nbdev/ in
12 from nbconvert import HTMLExporter
—> 14 if IN_NOTEBOOK:
15 from IPython.display import Markdown,display
16 from IPython.core import page

NameError: name ‘IN_NOTEBOOK’ is not defined

Does someone know how to solve it?

1 Like

Faced the same issue. Tried the solution to upgrade nbdev mentioned here.

That didnt work. Then downgraded the nbdev version from 1.1.0 to 1.0.18.
After that it worked.
You can downgrade with following command

pip install nbdev==1.0.18

Thank you!
It really solved the problem!
I don’t understand why this happened, conda should download the right dependencies by himself.

Thanks, using that version of nbdev worked for me too.

For people using anaconda you can do this too:

conda install -c fastai nbdev=1.0.18