文档章节

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
粉丝 4
博文 280
码字总数 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

没有更多内容

加载失败,请刷新页面

加载更多

Java 如何实现线程间通信?

正常情况下,每个子线程完成各自的任务就可以结束了。不过有的时候,我们希望多个线程协同工作来完成某个任务,这时就涉及到了线程间通信了。 本文涉及到的知识点: thread.join(), object....

颖辉小居
32分钟前
2
0
记一次阿里云服务器运行慢排除

公司测试环境用的阿里云服务器+docker部署的,一共跑了14个项目。之前几个月一直OK,最近几天突然很卡很慢。刚开始以为是项目问题,又是扩大内存,又是清减插件,甚至停了一半项目。结果CPU...

李玉长
33分钟前
2
0
统一客服消息返回错误:{"errcode":43004,"errmsg":"require subscribe hint: [9Vv08633952]"}

公众号或者小程序发送客服消息错误: {"errcode":43004,"errmsg":"require subscribe hint: [9Vv08633952]"} 场景:小程序使用公众号的服务消息,推送消息,如果接收人没有关注公众号,就会出...

tianma3798
44分钟前
1
0
Rainbond V5.0 Beta公测公告

Rainbond支撑企业应用的开发、架构、交付和运维的全流程,通过“无侵入”架构无缝衔接各类企业应用,底层资源可以对接和管理IaaS、虚拟机和物理服务器 Rainbond V5.0即日起开启Beta版本公测,...

好雨云帮
今天
2
0
Word Pattern(leetcode290)

Given a pattern and a string str, find if str follows the same pattern. Here follow means a full match, such that there is a bijection between a letter in pattern and a non-empt......

woshixin
今天
2
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部