pip简介
pip是python的包管理工具。
项目主页:https://pypi.python.org/pypi/pip
下载后安装
下载后解压,通过CMD终端进入解压的目录,然后输入以下命令:
python setup.py install
接下来设置环境变量
将 D:\program\Python\Python36\Scripts 添加至PATH,注意格式并替换你自己的python安装目录。
验证安装
C:\Users\mixh>pip list
DEPRECATION: The default format will switch to columns in the future. You can us
e –format=(legacy|columns) (or define a format=(legacy|columns) in your pip.con
f under the [list] section) to disable this warning.
lxml (4.1.1)
pip (9.0.1)
setuptools (28.8.0)
pip设置代理
安装包时设置代理的格式:
pip install –proxy http://username:password@proxyIP:proxyPort sphinx
我所在局域网的代码不用设置密码,故使用如下命令即可:
C:\Users\darkmi>pip install –proxy http://proxy.it.xxx.com:8080 nose
Collecting nose
Downloading nose-1.3.7-py3-none-any.whl (154kB)
39% |████████████▊ | 61kB 285kB/s eta 0:00:01
46% |██████████████▉ | 71kB 305kB/s eta 0:00:
52% |█████████████████ | 81kB 326kB/s eta 0:0
59% |███████████████████ | 92kB 362kB/s eta 0
66% |█████████████████████▏ | 102kB 389kB/s e
72% |███████████████████████▎ | 112kB 509kB/s
79% |█████████████████████████▍ | 122kB 585kB
86% |███████████████████████████▌ | 133kB 664
92% |█████████████████████████████▋ | 143kB 8
99% |███████████████████████████████▊| 153kB
100% |████████████████████████████████| 163k
B 736kB/s
Installing collected packages: nose
Successfully installed nose-1.3.7
pip的使用很简单,看一下帮助文档即可使用。
C:\Users\mixh>pip –help
Usage:
pip
Commands:
install Install packages.
download Download packages.
uninstall Uninstall packages.
freeze Output installed packages in requirements format.
list List installed packages.
show Show information about installed packages.
check Verify installed packages have compatible dependen
cies.
search Search PyPI for packages.
wheel Build wheels from your requirements.
hash Compute hashes of package archives.
completion A helper command used for command completion.
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. Option is additive, and can be
used up to 3 times (corresponding to WARNING,
ERROR, and CRITICAL logging levels).
–log
–proxy
[user:passwd@]proxy.server:port.
–retries
attempt (default 5 times).
–timeout
–exists-action
(s)witch, (i)gnore, (w)ipe, (b)ackup, (a)bort.
–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.
Sorry, the comment form is closed at this time.
No comments yet.