title: Jupyter notebook launch error
body: <p>When I try to run the command <code>jupyter-notebook</code>, I get the following error:</p>
  
  <pre><code>`Traceback (most recent call last):
    File "/home/leo/anaconda2/bin/jupyter-notebook", line 7, in &lt;module&gt;
      from notebook.notebookapp import main
    File "/usr/lib/python3/dist-packages/notebook/notebookapp.py", line 31, in &lt;module&gt;
      from zmq.eventloop import ioloop
    File "/usr/lib/python3/dist-packages/zmq/__init__.py", line 34, in &lt;module&gt;
      from zmq import backend
    File "/usr/lib/python3/dist-packages/zmq/backend/__init__.py", line 40, in &lt;module&gt;
      reraise(*exc_info)
    File "/usr/lib/python3/dist-packages/zmq/backend/__init__.py", line 27, in &lt;module&gt;
      _ns = select_backend(first)
    File "/usr/lib/python3/dist-packages/zmq/backend/select.py", line 26, in select_backend
      mod = __import__(name, fromlist=public_api)
    File "/usr/lib/python3/dist-packages/zmq/backend/cython/__init__.py", line 6, in &lt;module&gt;
      from . import (constants, error, message, context,
  ImportError: cannot import name constants
  </code></pre>
  
  <p>Many of the solutions I've encountered required to uninstall and reinstall the <code>pyzmq</code> package (via pip, conda, apt install; I've tried all of them). But that didn't work for me. </p>
  
  <p>However, looking at the error I get, I think there's something wrong in the second line, precisely here: <code>"/usr/lib/python3/dist-packages/notebook/notebookapp.py"</code>. It looks like there's some conflict among the two versions of Python I have.</p>
  
  <p>I have Anaconda for Python 2.7 installed in my PC, but recently I had to install Spyder for Python 3.x. May it be the case that something got corrupted after the installation?</p>
  
  <p><strong>What I already tried:</strong></p>
  
  <ul>
  <li>uninstall/reinstall pyzmq</li>
  <li>uninstall/reinstall jupyter</li>
  <li><p>tried to run <code>jupyter kernelspec list</code>, but got a similar error (which leads me to think there's actually a conflict):</p>
  
  <p><code>Traceback (most recent call last):
    File "/home/leo/anaconda2/bin/jupyter-kernelspec", line 7, in &lt;module&gt;
      from jupyter_client.kernelspecapp import KernelSpecApp
    File "/usr/lib/python3/dist-packages/jupyter_client/__init__.py", line 4, in &lt;module&gt;
      from .connect import *
    File "/usr/lib/python3/dist-packages/jupyter_client/connect.py", line 22, in &lt;module&gt;
      import zmq
    File "/usr/lib/python3/dist-packages/zmq/__init__.py", line 34, in &lt;module&gt;
      from zmq import backend
    File "/usr/lib/python3/dist-packages/zmq/backend/__init__.py", line 40, in &lt;module&gt;
      reraise(*exc_info)
    File "/usr/lib/python3/dist-packages/zmq/backend/__init__.py", line 27, in &lt;module&gt;
      _ns = select_backend(first)
    File "/usr/lib/python3/dist-packages/zmq/backend/select.py", line 26, in select_backend
      mod = __import__(name, fromlist=public_api)
    File "/usr/lib/python3/dist-packages/zmq/backend/cython/__init__.py", line 6, in &lt;module&gt;
      from . import (constants, error, message, context,
  ImportError: cannot import name constants</code></p></li>
  </ul>
  
  <hr>
  
  <p><strong>EDIT:</strong></p>
  
  <p>I've run the command </p>
  
  <pre><code>pip3 uninstall jupyter
  </code></pre>
  
  <p>as <em>Sangram Gaikwad</em> suggested, so now I'm not using the wrong jupyter notebook anymore. However, if I try to execute <code>jupyter-notebook</code>, now I get another error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "/home/leo/anaconda2/bin/jupyter-notebook", line 7, in &lt;module&gt;
      from notebook.notebookapp import main
    File "/home/leo/anaconda2/lib/python2.7/site-packages/notebook/__init__.py", line 25, in &lt;module&gt;
      from .nbextensions import install_nbextension
    File "/home/leo/anaconda2/lib/python2.7/site-packages/notebook/nbextensions.py", line 27, in &lt;module&gt;
      from jupyter_core.utils import ensure_dir_exists
  ImportError: cannot import name ensure_dir_exists
  </code></pre>
  
  <p><strong>What I tried:</strong></p>
  
  <ul>
  <li><p><code>conda update jupyter_core jupyter_client</code> (it says they're already installed)</p></li>
  <li><p><code>conda uninstall jupyter notebook</code>, then <code>conda install jupyter notebook</code> (still get the same error)</p></li>
  </ul>