文档章节

Installation Do I need to install pip?

rootliu
 rootliu
发布于 2017/09/12 10:41
字数 438
阅读 4
收藏 0
点赞 0
评论 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

© 著作权归作者所有

共有 人打赏支持
rootliu
粉丝 2
博文 222
码字总数 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

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

在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

Ubuntu安装配置 Shadowsocks客户端

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

CasparLi ⋅ 2016/07/18 ⋅ 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 ⋅ 0

Windows下python3安装pip管理包

方法有两种: 请参考:http://www.pip-installer.org/en/latest/installing.html#prerequisites 1.通过setuptools安装 安装setuptools,下载 https://pypi.python.org/pypi/setuptools setu......

白夜繁櫻 ⋅ 2013/07/16 ⋅ 0

Installation using setuptools and pip

Installation using setuptools and pip NOTE: If you don't want to touch system files or you don't have root, please see this question on stackoverflow. For everyone else please r......

66号公路 ⋅ 2015/10/28 ⋅ 0

Pip安装依赖于six、requests库失败的解决方法

Installing collected packages: six Found existing installation: six 1.4.1 DEPRECATION: Uninstalling a distutils installed project (six) has been deprecated and will be removed i......

liguoyuan ⋅ 05/29 ⋅ 0

python pip管理工具

对于python初学者来说,要安装python的包,常常需要用到pip。 作为一个资深新手,遇到的最大的问题: pip是什么? PyPI - the Python Package Index——python官方的第三方库的仓库,所有人都...

唐佳 ⋅ 2016/08/22 ⋅ 0

ToughRADIUS快速指南

ToughRADIUS快速指南 准备 一台完整的服务器,或者远程VPS,给服务器安装Linux系统,CentOS6以上,ubuntu14以上,或者其他你自己熟悉的Linux发行版。 你要懂一点技术,比如安装操作系统,会在...

jamiesun ⋅ 2016/03/30 ⋅ 0

没有更多内容

加载失败,请刷新页面

加载更多

下一页

1.01-StringUtils的使用

import org.apache.commons.lang.StringUtils; 一、StringUtils 常用的方法: 1. 判断某一字符串是否为空 , 为空的标准是 str==null 或 str.length()==0 StringUtils.isEmpty(null) ==>tr......

静以修身2025 ⋅ 17分钟前 ⋅ 0

几道Spring 面试题

1、BeanFactory 接口和 ApplicationContext 接口有什么区别? ApplicationContext 接口继承BeanFactory接口 Spring核心工厂是BeanFactory BeanFactory采取延迟加载,第一次getBean时才会初始...

职业搬砖20年 ⋅ 19分钟前 ⋅ 0

包饺子

http://storage.slide.news.sina.com.cn/slidenews/77_ori/2018_24/74766_826131_625489.gif

霜叶情 ⋅ 20分钟前 ⋅ 0

兑吧:从自建HBase迁移到阿里云HBase实战经验

摘要: 业务介绍 兑吧集团包含兑吧网络和推啊网络,兑吧网络是一家致力于帮助互联网企业提升运营效率的用户运营服务平台,提供积分商城和媒体运营服务。推啊网络是一家互动式广告平台,经过多...

猫耳m ⋅ 31分钟前 ⋅ 0

xml解析

方法一: String s_xml1 = "<xml>" + "<head>lalalalal</head>" + "<body>1234</body>" + "</xml>"; try { DocumentBuilderFactory documentBuilderFactory......

GithubXD ⋅ 32分钟前 ⋅ 0

reuse stream

Although Java streams were designed to be operated only once, programmers still ask how to reuse a stream. From a simple web search, we can find many posts with this same issue ......

idoz ⋅ 32分钟前 ⋅ 0

兑吧:从自建HBase迁移到阿里云HBase实战经验

摘要: 业务介绍 兑吧集团包含兑吧网络和推啊网络,兑吧网络是一家致力于帮助互联网企业提升运营效率的用户运营服务平台,提供积分商城和媒体运营服务。推啊网络是一家互动式广告平台,经过多...

阿里云云栖社区 ⋅ 34分钟前 ⋅ 0

从世界杯看国内运动体育社交新能量

2018年世界杯已正式拉开帷幕,一场全世界球迷的狂欢也正式开始。 世界杯影响力:30亿+球迷的狂欢+社交话题 世界杯这个超级IP和对社交网络的引爆让更多的人目光聚焦到国内运动体育社交这个层...

ThinkSNS账号 ⋅ 35分钟前 ⋅ 0

不固定值替换

<?php$arr = 20;$data = str_replace(array(10,20,30,40),array("blue","red","green","yellow"),$arr);print_r($data);...

nsns ⋅ 36分钟前 ⋅ 0

Job for nginx.service failed 错误解决方案

今天刚在centos7上安装了nginx-1.2.11,/etc/init.d/nginx start启动时,出现 Job for nginx.service failed because the control process exited with error code. See "systemctl status n......

河图再现 ⋅ 38分钟前 ⋅ 0

没有更多内容

加载失败,请刷新页面

加载更多

下一页

返回顶部
顶部