3

I want to run jupyter notebook, but the Mac I'm on has a messed up Anaconda environment. The old owner uninstalled some packages that I'd like to use-- jupyter notebook, pyzmq, etc. I want to use jupyter notebook, but after I tried to reinstall those packages manually using:

pip install jupyter
pip install pyzmq

I get errors when I run: jupyter notebook:

Traceback (most recent call last):
  File "//anaconda/bin/jupyter-notebook", line 4, in <module> import notebook.notebookapp
  File "//anaconda/lib/python2.7/site-packages/notebook/notebookapp.py", line 40, in <module> ioloop.install()
  File "//anaconda/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'

Can I just reinstall Anaconda again (or do I have to uninstall anaconda somehow and install over a clean system)?

Simba
  • 23,537
  • 7
  • 64
  • 76
anjchang
  • 483
  • 1
  • 7
  • 14
  • It's probably safest to uninstall and reinstall. But [uninstalling is pretty easy](https://conda.io/docs/user-guide/install/macos.html?highlight=uninstall#uninstalling-anaconda-or-miniconda). – abarnert May 01 '18 at 05:28
  • 1
    Also, while you're reinstalling, do you actually need to use Python 2.7? It's only a year and a half from going out of support, and it's already a second-class citizen with Jupyter/IPython and some other packages, so reinstall time may be a good time to migrate. – abarnert May 01 '18 at 05:35
  • Thanks @abarnert -- yes, I do need Python 2.7 for now, working with older code on an old computer. ;) – anjchang May 01 '18 at 06:46

1 Answers1

3

This answers in this post will address your issue

But, if you want to start over, I would suggest removing anaconda completely and then installing miniconda.

After you've installed miniconda, you can use:
conda install jupyter
conda install pyzmq
conda install WHATEVER_PACKAGE

  • Thank you! I removed anaconda using rm -rf //anaconda – anjchang May 01 '18 at 06:47
  • 1
    Then I was still getting the AttributeError: type object 'IOLoop' has no attribute 'initialized' and it turned out I had to upgrade pyzmq,pip, and tornado. See https://github.com/jupyter/notebook/issues/3407 – anjchang May 01 '18 at 06:48