30

I installed Miniconda and I'm trying to use Jupyter Notebook with it but haven't been able to do so. After installing miniconda I ran the jupyter notebook command on my terminal and jupyter wasn't installed.

I went ahead and installed it with the conda install jupyter. However, I once again ran jupyter notebook on my terminal and got the following console error:

Emilios-MacBook-Pro:documents emilioramirezeguia$ jupyter notebook Traceback (most recent call last): File "/Users/emilioramirezeguia/miniconda2/bin/jupyter-notebook", line 7, in from notebook.notebookapp import main File "/Users/emilioramirezeguia/miniconda2/lib/python2.7/site-packages/notebook/notebookapp.py", line 45, in ioloop.install() File "/Users/emilioramirezeguia/miniconda2/lib/python2.7/site-packages/zmq/eventloop/ioloop.py", line 210, in install assert (not ioloop.IOLoop.initialized()) or \ AttributeError: type object 'IOLoop' has no attribute 'initialized'

Console_Error

Any idea how to fix this?

Thank you

daviewales
  • 2,144
  • 21
  • 30
Emilio
  • 401
  • 1
  • 4
  • 7
  • It's hard to tell what's happening there. It's possible that some packages have the wrong versions. Have you tried updating `conda`? – daviewales Mar 06 '18 at 23:34
  • I have @daviewales ... I'm actually installing this for a **Codecademy** course. A few months ago I installed Python through [this guideline](https://www.codecademy.com/articles/setup-python) and until today installed **Microconda** through [this other one](https://www.codecademy.com/articles/install-python-data-analysis). I'm wondering if something may have overlapped. I might try uninstalling and reinstalling everything. – Emilio Mar 06 '18 at 23:52
  • It looks like it's getting everything from miniconda, but it's hard to tell. Incidentally, you already had a version of Python pre-installed, because Macs come with Python. Uninstalling everything, then reinstalling just miniconda is probably the easiest way to go. However, you could also investigate creating a Python virtual environment with miniconda. – daviewales Mar 07 '18 at 00:01
  • Sorry @daviewales, just realized I typed Microconda instead of *Miniconda*. Could you guide me through the quickest way to uninstall everything? – Emilio Mar 07 '18 at 00:06
  • Your best bet is to search `uninstall miniconda` in Google. The original Python installer you had from a few months ago *may* have an uninstall option if you run it again. Otherwise, you'll have to search how to uninstall it as well. – daviewales Mar 07 '18 at 00:27
  • I'm hesitant to tell you specifics, because I might miss something. But the screenshot above tells me that most of Miniconda is contained within `~/miniconda2`, so you could delete that directory. You will also need to fix up your PATH. Run `echo $PATH` in terminal to see it. Then try to find and delete the Miniconda lines in `~/.bashrc` or `~/.bash_profile`. But please look up more detailed instructions to make sure you don't miss anything. – daviewales Mar 07 '18 at 00:32
  • 1
    Okay @daviewales. I'll look into the suggestions you provided but will make sure to look up more detailed instructions before deleting anything. Thanks for helping out! =D – Emilio Mar 07 '18 at 00:34

4 Answers4

47

This problem has just happened to me as well. My older anaconda environments seem to be working fine but the environments I have created today seem to have this exact issue which throws AttributeError: type object 'IOLoop' has no attribute 'initialized'.

It seems to be because of the latest release of tornado==5.0 which released either today or yesterday. I reverted back to the last stable version i.e. tornado==4.5.3 and it worked.

Here's the solution

pip uninstall tornado
pip install tornado==4.5.3
nitred
  • 5,309
  • 3
  • 25
  • 29
  • AMAZING! Thanks @nitred, that solved the problem. =D – Emilio Mar 07 '18 at 02:58
  • Thank you. I couldn't get my work done today because of this error. Ugh. – SajidSalim Mar 07 '18 at 11:20
  • 1
    Thank you, Solved my problem! ) – Dmytro Biletskyi Mar 07 '18 at 12:21
  • 3
    Solved it for me also. I used `conda remove tornado`, `conda install tornado=4.5.3`, then reinstalled other required pkgs. Good catch. – Evan Mar 07 '18 at 17:48
  • I was using Jupyter with `tornado 5.1`, it was working. Just today it showed the above mentioned error. I installed **tornado==4.5.3**, it is working again. So does anyone have any idea on why suddenly it stopped working? – Ankit Seth Aug 01 '18 at 07:59
  • 1
    I had the same problem with `tornado 5.1.1` and uninstalling it as recommended (and reinstalling an older version) worked for me – Alf Oct 20 '18 at 20:19
3

Miniconda is OK but Anaconda is recommend.

I have the same issue and thanks Nitred give the right solution.

It seems that jupyter notebook does not support the tornado 5.0. So downgrade as the following:

pip uninstall tornado
pip install tornado==4.5.3
Steve
  • 59
  • 5
2

I needed matplotlib in python, and need jupyter working. The package will try to uninstall matplotlib if you uninstall tornado, unless you do a force. But I still need matplotlib, I need that. So I still need to force matplotlib to use the old version of tornado. Turns out I had two tornado versions, one installed by pip, other installed by conda.

Ultimately running these commands got jupyter and matplotlib working again: (Ran it in the conda environment that was broken.)

conda remove tornado --force # keeps matplotlib
pip uninstall tornado
conda install tornado=4.5.3

I earlier had used pip to install tensorflow library, which I also need, and maybe it brought along the junky tornado v5, not sure.

Geoffrey Anderson
  • 1,534
  • 17
  • 25
0

You must simply try doing -

conda install jupyterlab

(Perhaps, Anaconda team have updated the command in recent years or so). Above command works well on Windows/Ubuntu.

starball
  • 20,030
  • 7
  • 43
  • 238
Rishabh Barman
  • 499
  • 5
  • 8