Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Graphs and Charts

ModuleNotFoundError

When I pasted the code into jupyter and ran it, I got this:

ModuleNotFoundError Traceback (most recent call last) <ipython-input-9-4602a3fc97db> in <module> ----> 1 from ipywidgets import interact 2 import numpy as np 3 4 from bokeh.io import push_notebook, show, output_notebook 5 from bokeh.plotting import figure

ModuleNotFoundError: No module named 'ipywidgets'

On the video the teacher gets <function_main_.update>

I have windows, not mac. Also, when he says to run things in the terminal, does that mean git or the command prompt?

5 Answers

'jupyter' is not recognized as an internal or external command, operable program or batch file means it can't be located in your system path. So you'd have to find the location of jupyter.exe and add that to your system path.

I just installed the Anaconda distribution on Windows 10 and it appears to already include numpy and bokeh. There is an Anaconda Prompt where I was able to successfully enter both jupyter notebook and the extension command

(base) C:\Users\KN_2>jupyter nbextension enable --py --sys-prefix widgetsnbextension
Enabling notebook extension jupyter-js-widgets/extension...
      - Validating: ok

And the graph displays as it should.

How did you install jupyter?

The error is saying the ipywidgets module is not found. Try pip install ipywidgets. I had the same error and that is how I fixed it.

Also, in reply to the terminal question...

I am running in windows and the terminal I used was powershell, but I assume cmd (command prompt) would work.

Did you run?

!pip3 install numpy bokeh

and receive a message similar to this?

Successfully installed PyYAML-5.1 bokeh-1.1.0 numpy-1.16.3 packaging-19.0 pillow-6.0.0 pyparsing-2.4.0

and did you run?

jupyter nbextension enable --py --sys-prefix widgetsnbextension

I have windows so I actually had to run !pip install numpy bokeh (not !pip3) He is suggesting running jupyter nbextension enable --py --sys-prefix widgetsnbextension in the terminal. When I do that it says 'jupyter' is not recognized as an internal or external command, operable program or batch file.

But before then, in jupyter, the expected response to the code the teacher has us paste in is <function_main_.update> and I get the ModuleNotFoundError as pasted above. So that indicates there is something wrong BEFORE needing to run the extension in the terminal.

Any insights?