title: pip3 error - '_NamespacePath' object has no attribute 'sort'
body: <p>I tried to install a package through pip3, and I got this error. Every pip/pip3 command that I run gives me this error- </p>
  
  <pre><code>alexg@hitbox:~$ pip3 -V
  Traceback (most recent call last):
    File "/usr/local/bin/pip3", line 7, in &lt;module&gt;
      from pip import main
    File "/home/alexg/.local/lib/python3.5/site-packages/pip/__init__.py", line 26, in &lt;module&gt;
      from pip.utils import get_installed_distributions, get_prog
    File "/home/alexg/.local/lib/python3.5/site-packages/pip/utils/__init__.py", line 27, in &lt;module&gt;
      from pip._vendor import pkg_resources
    File "/home/alexg/.local/lib/python3.5/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3018, in &lt;module&gt;
      @_call_aside
    File "/home/alexg/.local/lib/python3.5/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3004, in _call_aside
      f(*args, **kwargs)
    File "/home/alexg/.local/lib/python3.5/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3046, in _initialize_master_working_set
      dist.activate(replace=False)
    File "/home/alexg/.local/lib/python3.5/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2578, in activate
      declare_namespace(pkg)
    File "/home/alexg/.local/lib/python3.5/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2152, in declare_namespace
      _handle_ns(packageName, path_item)
    File "/home/alexg/.local/lib/python3.5/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2092, in _handle_ns
      _rebuild_mod_path(path, packageName, module)
    File "/home/alexg/.local/lib/python3.5/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2121, in _rebuild_mod_path
      orig_path.sort(key=position_in_sys_path)
  AttributeError: '_NamespacePath' object has no attribute 'sort'
  </code></pre>
  
  <p>I have tried running <code>pip3 install --upgrade pip setuptools</code> according to some answers, but every pip command gives me the error. I'm stuck and can't do anything.</p>
  
  <p>What could have caused it, and how can this be fixed?</p>
  
  <p>I'm on Ubuntu <code>16.04</code> with Python <code>3.5.2</code></p>