title: Jupyter cannot start, "ImportError: This package should not be accessible"
body: <p>I am unable to start a Jupyter notebook server on a linux machine. When I type <code>jupyter notebook</code>, I get the following errors:</p>
  
  <pre><code>ImportError: This package should not be accessible on Python 3. Either you are trying to run from the python-future src folder or your installation of python-future is corrupted.
  During handling of the above exception, another exception occurred:
  ModuleNotFoundError: No module named 'urlparse'
  </code></pre>
  
  <p>Here is some system info, let me know if anything else might be helpful:</p>
  
  <pre><code>$ jupyter --version
  4.4.0
  
  $ which jupyter
  /usr/bin/jupyter
  
  $ which python
  /usr/bin/python
  
  $ which python3
  /usr/bin/python3
  
  $ cat /etc/lsb-release
  DISTRIB_ID=Ubuntu
  DISTRIB_RELEASE=18.04
  DISTRIB_CODENAME=bionic
  DISTRIB_DESCRIPTION="Ubuntu 18.04.1 LTS"
  
  $ cat /proc/version
  Linux version 4.15.0-38-generic (buildd@lcy01-amd64-023) (gcc version 7.3.0 (Ubuntu 7.3.0-16ubuntu3)) #41-Ubuntu SMP Wed Oct 10 10:59:38 UTC 2018
  
  $ pip3 --version
  pip 9.0.1 from /usr/local/lib/python3.6/dist-packages (python 3.6)
  </code></pre>
  
  <p>When I try <code>python2 -m pip install urlparse --user</code>, I get an error: <code>Collecting urlparse Could not find a version that satisfies the requirement</code></p>
  
  <p>The reported error resembles <a href="https://community.lsst.org/t/running-jupyter-notebook-existing-python-3-5-interferes/2152" rel="nofollow noreferrer">the one shown here</a>, but the stated solution of creating and using a python3 virtual environment doesn't seem to immediately fix the <code>jupyter notebook</code> command, although it does replace <code>python</code> and <code>python3</code> executable with links to the virtual environment:</p>
  
  <pre><code>(env) $ which jupyter
  /usr/bin/jupyter
  (env) $ which python
  /home/.../env/bin/python
  (env) $ which python3
  /home/.../env/bin/python3
  </code></pre>
  
  <p>In case there is some question about the python path, here is the path for python 2:</p>
  
  <pre><code>$ ipython
  ...
  In [2]: sys.path
  Out[2]: 
  ['/usr/lib/python2.7',
   '/usr/lib/python2.7/plat-x86_64-linux-gnu',
   '/usr/lib/python2.7/lib-tk',
   '/usr/lib/python2.7/lib-old',
   '/usr/lib/python2.7/lib-dynload',
   '/home/$USER/.local/lib/python2.7/site-packages',
   '/usr/local/lib/python2.7/dist-packages',
   '/usr/lib/python2.7/dist-packages',
   '/usr/lib/python2.7/dist-packages/gtk-2.0',
   '/home/$USER/.local/lib/python2.7/site-packages/IPython/extensions',
   '/home/$USER/.ipython']
  </code></pre>
  
  <p>And for python3</p>
  
  <pre><code>$ ipython3
  ...
  In [2]: sys.path                                                                                                                                 
  Out[2]: 
  ['/usr/lib/python36.zip',
   '/usr/lib/python3.6',
   '/usr/lib/python3.6/lib-dynload',
   '/home/$USER/.local/lib/python3.6/site-packages',
   '/usr/local/lib/python3.6/dist-packages',
   '/usr/lib/python3/dist-packages',
   '/home/$USER/.local/lib/python3.6/site-packages/IPython/extensions',
   '/home/$USER/.ipython']
  </code></pre>
  
  <p>The full stack trace of the first error when starting Jupyter is:</p>
  
  <pre><code>Traceback (most recent call last):
    File "/usr/lib/python3/dist-packages/notebook/nbextensions.py", line 18, in &lt;module&gt;
      from urllib.request import urlretrieve
    File "/usr/lib/python3.6/urllib/request.py", line 88, in &lt;module&gt;
      import http.client
    File "/home/$USER/.local/lib/python3.6/site-packages/http/__init__.py", line 7, in &lt;module&gt;
      raise ImportError('This package should not be accessible on Python 3. '
  ImportError: This package should not be accessible on Python 3. Either you are trying to run from the python-future src folder or your installation of python-future is corrupted.
  </code></pre>
  
  <p>The contents of <code>/usr/bin/jupyter</code> are as follows:</p>
  
  <pre><code>$ cat `which jupyter`
  #!/usr/bin/python3
  # EASY-INSTALL-ENTRY-SCRIPT: 'jupyter-core==4.4.0','console_scripts','jupyter'
  __requires__ = 'jupyter-core==4.4.0'
  import re
  import sys
  from pkg_resources import load_entry_point
  
  if __name__ == '__main__':
      sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
      sys.exit(
          load_entry_point('jupyter-core==4.4.0', 'console_scripts', 'jupyter')()
      )
  </code></pre>
  
  <p>One suggested answer is that there is a spurious <code>http</code> library, "<em>it happens to be overridden by some 3rd-party module "http" at /home/$USER/.local/lib/python3.6/site-packages/http</em>". When I remove this library manually, I now get an error importing the <code>site</code> module, as follows:</p>
  
  <pre><code>$ cd /home/$USER/.local/lib/python3.6/site-packages
  $ mv ./http ~/Desktop/python_disabled/python3/
  $ jupyter notebook
  Error processing line 1 of /home/$USER/.local/lib/python3.6/site-packages/lazr.restfulclient-0.14.0-py3.6-nspkg.pth:
  
  Failed to import the site module
  Traceback (most recent call last):
    File "/usr/lib/python3.6/site.py", line 174, in addpackage
      exec(line)
    File "&lt;string&gt;", line 1, in &lt;module&gt;
    File "/usr/lib/python3.6/types.py", line 171, in &lt;module&gt;
      import functools as _functools
    File "/usr/lib/python3.6/functools.py", line 21, in &lt;module&gt;
      from collections import namedtuple
    File "/usr/lib/python3.6/collections/__init__.py", line 32, in &lt;module&gt;
      from reprlib import recursive_repr as _recursive_repr
    File "/home/$USER/.local/lib/python3.6/site-packages/reprlib/__init__.py", line 7, in &lt;module&gt;
      raise ImportError('This package should not be accessible on Python 3. '
  ImportError: This package should not be accessible on Python 3. Either you are trying to run from the python-future src folder or your installation of python-future is corrupted.
  </code></pre>