文档章节

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
博文 244
码字总数 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

没有更多内容

加载失败,请刷新页面

加载更多

下一页

angular指令监听ng-repeat渲染完成后执行自定义事件方法

今天工作中遇到需要用到ng-repeat遍历渲染完后执行某个操作,angular本身并没有提供监听ng-repeat渲染完成的指令,所以需要自己创建自定义指令。 在ng-repeat模板实例内部会暴露出一些特殊属...

孟飞阳
40分钟前
1
0
URLEncoder和URLDecoder

public static void main(String[] args) { String str1 = "https://test1-life.pingan.com/ilifecore/productMall/loading.html?productId=8000000241&channelCode=XCX00001&productCode=00......

鬼才王
50分钟前
2
0
对象及变量的并发访问-第一篇

方法内部的变量为线程安全变量 “非线程安全”问题存在于“共享变量”中,如果是方法内部的私有变量,则不存在“非线程安全”问题,所得结果也就是“线程安全”的。 package chaprer3;/**...

简心
51分钟前
1
0
程序媛眼中的程序猿原来是这样子的!

一直都想写一篇关于描述程序员的文章,但是一直没能开头,一来因为文笔不好,更主要的原因是貌似对程序员既熟悉又不熟悉,很怕写出来的是以偏概全,给大家造成对程序员的既定印象,不过,管他...

Java小铺
今天
1
0
bean标签

声明:本栏目所使用的素材都是凯哥学堂VIP学员所写,学员有权匿名,对文章有最终解释权;凯哥学堂旨在促进VIP学员互相学习的基础上公开笔记。 bean标签 bean标签中的init-method属性,该属性...

凯哥学堂
今天
1
0

没有更多内容

加载失败,请刷新页面

加载更多

下一页

返回顶部
顶部