安裝套件:pip install PackageName
更新套件:pip install -U PackageName
移除套件:pip uninstall PackageName
搜索套件:pip search PackageName
显示说明:pip help
pip的帮助文件:
C:\Python27\Lib\site-packages>pip -help
Usage:
pip
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.
help Show help for commands.
General Options:
-h, --help Show help.
--isolated Run pip in an isolated mode, ignoring
environment variables and user configuration.
-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
--proxy
[user:passwd@]proxy.server:port.
--retries
attempt (default 5 times).
--timeout
--exists-action
(s)witch, (i)gnore, (w)ipe, (b)ackup.
--trusted-host
not have valid or any HTTPS.
--cert
--client-cert
containing the private key and the certificate
in PEM format.
--cache-dir
--no-cache-dir Disable the cache.
--disable-pip-version-check
Don't periodically check PyPI to determine
whether a new version of pip is available for
download. Implied with --no-index.
|
shell> python
>>> from distutils.sysconfig import get_python_lib
windows pip 下载安装位置
>>> print get_python_lib() # Python v2.x
/Library/Python/2.7/site-packages
>>> print(get_python_lib()) # Python v3.x
/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/site-packages
|