6

I'm new in Ipython and Jupyter Notebook. I installed the ipywidgets module in Jupyter Notebook by using Anaconda prompt window.

I tried:

pip install ipywidgets

It said that the requirements had already satisfied. Then I tried to import the module but received the "ImportError: No module named ipywidgets" error.

Then I tried:

conda install ipywidgets

It fetched some files from the "api.anaconda.org" site and installed the files. I exited from Jupyter Notebook and entered again. When I tried to import the modüle received the same "ImportError: No module named ipywidgets" error.

I have no idea what is wrong. How can I import this modüle to Jupyter Notebook and Anaconda ?

Thomas K
  • 39,200
  • 7
  • 84
  • 86
Erdem
  • 105
  • 2
  • 9
  • What happens when you open a terminal Python, and import? – Ami Tavory Feb 28 '16 at 19:19
  • There is no problem with the teminal. I can import the modüle in terminal window. But ı can't import in Jupyter Notebook. – Erdem Feb 28 '16 at 19:23
  • Do you perhaps have more than a single Python installation (maybe 2 and 3)? Which OS is it? If on linux, what is the output of `ls /usr/bin/python*`? – Ami Tavory Feb 28 '16 at 19:31
  • My OS is Windows 10. I installed the Python 2 and Python 3 kernels together on the Jupyter Notebook. When I used the "conda install ipywidgets" command it installed it on the Python 2. While I was trying to import the module current kernel was Python 2 on the Jupyter Notebook. – Erdem Feb 28 '16 at 19:38
  • Well, I'm stumped. Good luck to you. – Ami Tavory Feb 28 '16 at 19:40
  • 1
    If you activate the environment you installed it into, can you run `ipython` in a command prompt and try importing ipywidgets? If that works (or at least gives a different error), your Python 2 kernel may not be using the same environment that you installed it into. – Thomas K Feb 28 '16 at 20:57
  • I unistalled Python 2 and Python 3 kernels both . Than I installed them again. While installing at the same time I upgraded the pip version. Now there isn't any problem. But I haven't been able to find the source of the error so far. – Erdem Feb 28 '16 at 21:07
  • @ThomasK how can one check what environment the Python2 kernel is using? I have the same problem but unable to fix it yet. – Mischief_Monkey Aug 24 '16 at 12:54
  • `sys.executable` gives you the location of the Python you're running in; that should show you which environment it's in. – Thomas K Aug 24 '16 at 15:28

0 Answers0