文档章节

Installation Do I need to install pip?

rootliu
 rootliu
发布于 2017/09/12 10:41
字数 438
阅读 5
收藏 0

Installation

Do I need to install pip?

pip is already installed if you're using Python 2 >=2.7.9 or Python 3 >=3.4 binaries downloaded from python.org, but you'll need to upgrade pip.

Additionally, pip will already be installed if you're working in a Virtual Environment created by virtualenv or pyvenv.

Installing with get-pip.py

To install pip, securely download get-pip.py. [2]

Then run the following:

python get-pip.py

Warning

Be cautious if you're using a Python install that's managed by your operating system or another package manager. get-pip.py does not coordinate with those tools, and may leave your system in an inconsistent state.

get-pip.py will also install setuptools [3] and wheel, if they're not already. setuptools is required to install source distributions. Both are required to be able to build a Wheel Cache (which improves installation speed), although neither are required to install pre-built wheels.

Note

The get-pip.py script is supported on the same python version as pip. For the now unsupported Python 3.2, an alternate script is available here.

get-pip.py options

--no-setuptools

If set, don't attempt to install setuptools

--no-wheel

If set, don't attempt to install wheel

Additionally, get-pip.py supports using the pip install options and the general options. Below are some examples:

Install from local copies of pip and setuptools:

python get-pip.py --no-index --find-links=/local/copies

Install to the user site [4]:

python get-pip.py --user

Install behind a proxy:

python get-pip.py --proxy="[user:passwd@]proxy.server:port"

Using Linux Package Managers

See Installing pip/setuptools/wheel with Linux Package Managers in the Python Packaging User Guide.

Upgrading pip

On Linux or macOS:

pip install -U pip

On Windows [5]:

python -m pip install -U pip

Python and OS Compatibility

pip works with CPython versions 2.6, 2.7, 3.3, 3.4, 3.5 and also pypy.

This means pip works on the latest patch version of each of these minor versions (i.e. 2.6.9 for 2.6, etc). Previous patch versions are supported on a best effort approach.

pip works on Unix/Linux, macOS, and Windows.

[1] For Python 2, see https://docs.python.org/2/installing, and for Python3, see https://docs.python.org/3/installing.
[2] "Secure" in this context means using a modern browser or a tool like curl that verifies SSL certificates when downloading from https URLs.
[3] Beginning with pip v1.5.1, get-pip.py stopped requiring setuptools to be installed first.
[4] The pip developers are considering making --user the default for all installs, including get-pip.py installs of pip, but at this time, --user installs for pip itself, should not be considered to be fully tested or endorsed. For discussion, see Issue 1668.
[5] https://github.com/pypa/pip/issues/1299

本文转载自:https://pip.pypa.io/en/stable/installing/

共有 人打赏支持
rootliu
粉丝 2
博文 252
码字总数 2796
作品 0
海淀
数据库管理员
【转载】Python包管理工具pip与easy_install

初学 Python,总是提示缺少各种各样的 Python 包,于是了解了下 Python 的包安装管理工具: 1.setuptools 中的 easy_install (Download, build, install, upgrade, and uninstall Python pa...

摩云飞
2012/11/10
0
0
wywincl/LDTPLibrary

ldtp library for Robot Framework Introduction LDTPLibrary is a linux desktop GUI application testing library for Robot Framework that leverages the ldtp libraries from the LDTP ......

wywincl
2016/04/28
0
0
在centos 7.1上部署weibbix

安装pip yum install -y openssl epel-release python-pip 安装Django 1.8.18 pip install Django==1.8.18 安装MariaDB yum install -y mariadb mariadb-server mariadb-devel systemctl sta......

1321385590
2017/11/14
0
0
Ubuntu安装配置 Shadowsocks客户端

安装python-pip 安装客户端(二选一) 安装 [shadowsocks-qt5][link2-1] 安装 [shadowsocks][link2-2] CLI客户端 配置 shadowsocks 客户端 启动shadowsocks 客户端 安装 [genpac][link4-1] 生成...

CasparLi
2016/07/18
1K
0
cygwin 安装paramiko

解决依赖环境问题 Error: Microsoft Visual C++ 10.0 is required (Unable to find vcvarsall.bat) 解决办法:export VS100COMNTOOLS=$VS140COMNTOOLS buildtemp.win32-2.7Release_openssl.......

IT追寻者
2016/10/28
11
0

没有更多内容

加载失败,请刷新页面

加载更多

Spring中static变量不能@value注入的原因

今天本想使用@Value的方式使类中的变量获得yml文件中的配置值,然而一直失败,获得的一直为null。 类似于这样写的。 public class RedisShardedPool { private static ShardedJedisPool pool...

钟然千落
14分钟前
0
0
CentOS7防火墙firewalld操作

firewalld Linux上新用的防火墙软件,跟iptables差不多的工具。 firewall-cmd 是 firewalld 的字符界面管理工具,firewalld是CentOS7的一大特性,最大的好处有两个:支持动态更新,不用重启服...

dingdayu
今天
1
0
关于组件化的最初步

一个工程可能会有多个版本,有国际版、国内版、还有针对各种不同的渠道化的打包版本、这个属于我们日常经常见到的打包差异化版本需求。 而对于工程的开发,比如以前的公司,分成了有三大块业...

DannyCoder
今天
2
0
Spring的Resttemplate发送带header的post请求

private HttpHeaders getJsonHeader() { HttpHeaders headers = new HttpHeaders(); MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8"); ......

qiang123
昨天
3
0
Spring Cloud Gateway 之 Only one connection receive subscriber allowed

都说Spring Cloud Gateway好,我也来试试,可是配置了总是报下面这个错误: java.lang.IllegalStateException: Only one connection receive subscriber allowed. 困扰了我几天的问题,原来...

ThinkGem
昨天
31
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部