windows系统安装pip记录

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 [options]

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 Path to a verbose appending log.
--proxy Specify a proxy in the form
[user:passwd@]proxy.server:port.
--retries Maximum number of retries each connection should
attempt (default 5 times).
--timeout Set the socket timeout (default 15 seconds).
--exists-action Default action when a path already exists:
(s)witch, (i)gnore, (w)ipe, (b)ackup, (a)bort.
--trusted-host Mark this host as trusted, even though it does
not have valid or any HTTPS.
--cert Path to alternate CA bundle.
--client-cert Path to SSL client certificate, a single file
containing the private key and the certificate
in PEM format.
--cache-dir

Store the cache data in .
--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.

官方的安装教程:https://pip.pypa.io/en/stable/installing/

此条目发表在python分类目录,贴了标签。将固定链接加入收藏夹。

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据