升级到 ubuntu-16.10 后 Pip 不起作用 [英] Pip does not work after upgrade to ubuntu-16.10
本文介绍了升级到 ubuntu-16.10 后 Pip 不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
与 pip 一起运行命令会出现以下错误.即使命令 pip -V
也会产生以下错误.
我读到错误是由 setuptools 版本 31.0.0 引起的,它应该低于 28.0.0.但是我的 setuptools 版本是 26.1.1,它仍然给出相同的错误.
解决方案
我能找到的唯一解决方案是重新安装 pip
.在您的终端上运行这些命令
wget https://bootstrap.pypa.io/get-pip.py
sudo -H python get-pip.py --prefix=/usr/local/
但是,这只适用于 pip
,不适用于 pip3
!
Running a command alongwith pip gives the following error. Even the command pip -V
produces the following error.
I read that the error is due to setuptools version 31.0.0 and it should be lower than 28.0.0. But the version of my setuptools is 26.1.1 and it still gives the same error.
Traceback (most recent call last): File "/usr/local/bin/pip", line 7, in from pip import main File "/usr/local/lib/python3.5/dist-packages/pip/__init__.py", line 26, in from pip.utils import get_installed_distributions, get_prog File "/usr/local/lib/python3.5/dist-packages/pip/utils/__init__.py", line 27, in from pip._vendor import pkg_resources File "/usr/local/lib/python3.5/dist-packages/pip/_vendor/pkg_resources/__init__.py", line 3018, in @_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'
解决方案
The only solution I could find is reinstalling pip
. Run these commands on your terminal
wget https://bootstrap.pypa.io/get-pip.py
sudo -H python get-pip.py --prefix=/usr/local/
However, this works only for pip
, not pip3
!
这篇关于升级到 ubuntu-16.10 后 Pip 不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文