ubuntu 17.04中缺少pip setuptools

时间:2017-04-22 19:02:49

标签: ubuntu pip setuptools

我对新的ubuntu 17.04有一个非常奇怪的问题,当我尝试从pip安装东西时我无法做到这一点......这是错误:

sudo pip install psutil

The directory '/home/metu/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/metu/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting psutil
Downloading psutil-5.2.2.tar.gz (348kB)
100% |████████████████████████████████| 358kB 1.3MB/s 
Could not import setuptools which is required to install from a source 
distribution.
 Traceback (most recent call last):
 File "/usr/lib/python2.7/dist-packages/pip/req/req_install.py", line 387, in setup_py
 import setuptools  # noqa
 File "/usr/share/python-wheels/setuptools-32.3.1-py2.py3-none-any.whl/setuptools/__init__.py", line 10, in <module>
 File "/usr/share/python-wheels/setuptools-32.3.1-py2.py3-none-any.whl/setuptools/extern/__init__.py", line 1, in <module>
 ImportError: No module named extern

我想要安装的任何工具都会发生这种情况。 beautifulsoap,flask ecc ...

Python是版本:

Python 2.7.13

Pip是最新版本:

pip 9.0.1 from /usr/lib/python2.7/dist-packages (python 2.7)

安装了setuptools:

sudo apt-get install python-setuptools
python-setuptools is already the newest version (33.1.1-1).

使用pycharm正确安装了软件包,但是我要包含很多库,我不能逐个安装,有些像烧瓶登录库一样缺失......

感谢您的帮助

1 个答案:

答案 0 :(得分:0)

extern是必需的,没有安装,所以下载extern:

https://pypi.python.org/pypi/extern

并使用以下命令安装它:

python setup.py install

如果问题仍未解决,请从pip中卸载setuptools

pip uninstall setuptools