Forums

pip install --user error

whenever I try to install any addon via pipe the system keeps me the following error as I can

Traceback (most recent call last):
  File "/usr/local/bin/pip3.5", line 7, in <module>
    from pip import main
  File "/usr/local/lib/python3.5/dist-packages/pip/__init__.py", line 26,
 in <module>
    from pip.utils import get_installed_distributions, get_prog
  File "/usr/local/lib/python3.5/dist-packages/pip/utils/__init__.py", li
ne 27, in <module>
    from pip._vendor import pkg_resources
  File "/usr/local/lib/python3.5/dist-packages/pip/_vendor/pkg_resources/
__init__.py", line 3018, in <module>
    @_call_aside
  File "/usr/local/lib/python3.5/dist-packages/pip/_vendor/pkg_resources/
__init__.py", line 3004, in _call_aside
    f(*args, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/pip/_vendor/pkg_resources/
__init__.py", line 3046, in _initialize_master_working_set
    dist.activate(replace=False)
  File "/usr/local/lib/python3.5/dist-packages/pip/_vendor/pkg_resources/
__init__.py", line 2578, in activate
    declare_namespace(pkg)
  File "/usr/local/lib/python3.5/dist-packages/pip/_vendor/pkg_resources/
__init__.py", line 2152, in declare_namespace
    _handle_ns(packageName, path_item)
  File "/usr/local/lib/python3.5/dist-packages/pip/_vendor/pkg_resources/
__init__.py", line 2092, in _handle_ns
    _rebuild_mod_path(path, packageName, module)
  File "/usr/local/lib/python3.5/dist-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'

[edit by admin: formatting]

That sounds like something might have installed a broken version of setuptools. Do you have the same problem with pip3.4 or pip3.6?

only on 3.5 and 3.6

Does running easy_install3.5 --user setuptools help?

easy_install3.5 --user setuptools

bash: easy_install3.5: command not found

easy_install --user setuptools

Searching for setuptools Best match: setuptools 38.5.1 Adding setuptools 38.5.1 to easy-install.pth file Installing easy_install script to /home/mgaforever/.local/bin Installing easy_install-3.6 script to /home/mgaforever/.local/bin

Using /home/mgaforever/.local/lib/python3.4/site-packages Processing dependencies for setuptools Finished processing dependencies for setuptools

pip install --user

Traceback (most recent call last): File "/usr/local/bin/pip", line 7, in <module> from pip import main File "/usr/local/lib/python2.7/dist-packages/pip/init.py", line 16, in <module> from pip.vcs import git, mercurial, subversion, bazaar # noqa File "/usr/local/lib/python2.7/dist-packages/pip/vcs/mercurial.py", line 9, in <module> from pip.download import path_to_url File "/usr/local/lib/python2.7/dist-packages/pip/download.py", line 39, in <module> from pip._vendor import requests, six File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/init.py", line 64, in <module> from . import utils File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/utils.py", line 24, in <module> from .compat import parse_http_list as _parse_list_header File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/compat.py", line 38, in <module> from urllib2 import parse_http_list ImportError: cannot import name parse_http_list

It's easy_install-3.5 --user setuptools. Try that.