1ãå
说ä¸ä¸ä»ä¹æ¯pip
pip æ¯âA tool for installing and managing Python packages.âï¼ä¹å°±æ¯è¯´pipæ¯pythonç软件å®è£
å·¥å
·
2ãä¸é¢ä»ç»æä¹å¨linuxä¸å®è£
pip
ä¸è½½pipå°/usr/local/src
# cd /usr/local/src
# wget "
https://pypi.python.org/packages/source/p/pip/pip-1.5.4.tar.gz#md5=834b2904f92d46aaa333267fb1c922bb" --no-check-certificate
å¦ææ示ï¼-bash: wget: command not found
é£ä¹å®è£
wgetï¼æ§è¡å¦ä¸ï¼
# yum -y install wget
解夺å®è£
pip
# tar -xzvf pip-1.5.4.tar.gz
# cd pip-1.5.4
# python setup.py install
å¦æå®è£
æ¥ä¸é¢çéï¼
Traceback (most recent call last):
File "setup.py", line 6, in <module>
from setuptools import setup, find_packages
ImportError: No module named setuptools
é£ä¹å°±è¦å
å®è£
setuptoolså
(1)ä¸è½½setuptoolså
# wget
http://pypi.python.org/packages/source/s/setuptools/setuptools-2.0.tar.gz(2)解åsetuptoolså
# tar zxvf setuptools-2.0.tar.gz
# cd setuptools-2.0
(3)ç¼è¯setuptools
# python setup.py build
(4)å¼å§æ§è¡setuptoolså®è£
# python setup.py install
å®è£
å®æsetuptoolså
åï¼å¨éæ°æ§è¡ï¼
# cd /usr/local/src/pip-1.5.4
# python setup.py install
è³æ¤pipå®è£
å®æ
3ãlinuxä¸pip使ç¨åæ°
# pip --help
Usage:
pip <command> [options]
Commands:
install Install packages.
uninstall Uninstall packages.
freeze Output installed packages in requirements format.
list List installed packages.
show Show information about installed packages.
search Search PyPI for packages.
wheel Build wheels from your requirements.
zip DEPRECATED. Zip individual packages.
unzip DEPRECATED. Unzip individual packages.
bundle DEPRECATED. Create pybundles.
help Show help for commands.
General Options:
-h, --help Show help.
-v, --verbose Give more output. Option is additive, and can be used up to 3 times.
-V, --version Show version and exit.
-q, --quiet Give less output.
--log-file <path> Path to a verbose non-appending log, that only logs failures. This log is active by default at /root/.pip/pip.log.
--log <path> Path to a verbose appending log. This log is inactive by default.
--proxy <proxy> Specify a proxy in the form [user:passwd@]proxy.server:port.
--timeout <sec> Set the socket timeout (default 15 seconds).
--exists-action <action> Default action when a path already exists: (s)witch, (i)gnore, (w)ipe, (b)ackup.
--cert <path> Path to alternate CA bundle.