python install XXXmodule

First, install pip:

sudo apt install python-pip

Usually the old version was installed.

Then,  'pip install Image'

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-aw5SyO/django/

You are using pip version 8.1.1, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.


Solution:

sudo python -m pip install --upgrade --force pip 
sudo pip install setuptools==33.1.1

If not completely successful, use 'sudo apt autoremove' as written in the installing history.

Finally:

sudo pip install XXXmodule

dont miss 'sudo'


http://www.zhimengzhe.com/linux/290159.html


后面加了 sudo pip install requests

却提示失败,无法collect……(好坑)

The directory ‘/home/bzy/.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.

Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by ‘ReadTimeoutError(“HTTPSConnectionPool(host=’pypi.python.org’, port=443): Read timed out. (read timeout=15)”,)’: /simple/requests/

最后仔细看了下
sudo pip install requests
的报错信息
才知道要加上 -H

sudo -H pip install requests


猜你喜欢

转载自blog.csdn.net/tinktanker/article/details/79354183