官网原链接:https://pip.pypa.io/en/stable/installing/

Installation

Do I need to install pip?

pip is already installed if you are using Python 2 >=2.7.9 or Python 3 >=3.4 downloaded from python.org or if you are working in a Virtual Environment created by virtualenv or pyvenv. Just make sure to upgrade pip.

Installing with get-pip.py

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

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py

Inspect get-pip.py for any malevolence. Then run the following:

 到这一步的时候,如果python2的pip坏了,就运行:python2 get-pip.py

 如果是python3的pip坏了,升级就运行:python3 get-pip.py

python get-pip.py

Warning

Be cautious if you are using a Python install that is 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 also installs setuptools [2] and wheel if they are not already. setuptools is required to install source distributions. Both are required in order 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 2.6, alternate script is available here.

get-pip.py options

--no-setuptools

If set, do not attempt to install setuptools

--no-wheel

If set, do not attempt to install wheel

get-pip.py allows 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 [3]:

python get-pip.py --user

Install behind a proxy:

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

Upgrading pip

On Linux or macOS:

pip install -U pip

On Windows [4]:

python -m pip install -U pip

Python and OS Compatibility

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

This means pip works on the latest patch version of each of these minor versions. Previous patch versions are supported on a best effort approach.

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


[1] "Secure" in this context means using a modern browser or a tool like curl that verifies SSL certificates when downloading from https URLs.
[2] Beginning with pip v1.5.1, get-pip.py stopped requiring setuptools to be installed first.
[3] 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.

系统中同时存在python2和python3时 pip有时候更新后会报错 解决安装的方法如下的更多相关文章

  1. Eclipse中导入项目后js报错解决方法(转未解决问题)

    本文转自:http://blog.csdn.net/chenchunlin526/article/details/54666882 Eclipse中导入项目后js报错的原因与解决方法 在我们将项目导入 ...

  2. 本地同时安装python2和python3时pip报错

    引言: 安装完成后,想测试一下两个版本的pip是否都可以正常工作,结果python3的能正常工作,但是pip2 --version就会报错,报错信息如下: Traceback (most recent ...

  3. 【解决】MacOS下 Python3.7 使用 pyinstaller 打包后执行报错 Failed to execute script pyi_rth__tkinter

    Fix tcl/tk libs inclusion in tkinter with Python3.7 under MacOS 使用 Pyinstaller 打包时候报错 3027 ERROR: Tc ...

  4. VSFTP 连接时425 Security: Bad IP connecting.报错-----解决方法

    当登录FTP时候出现这个报错时.是因为PASV模式的安全检查是开启的(默认是开启的)  ftp> ls227 Entering Passive Mode (172,16,101,33,35,58 ...

  5. 系统中同时有 python2和 python3,怎么让 ipython 选择不同的版本启动?

    已经安装的情况下: > which ipython /usr/local/bin/ipython > cat /usr/local/bin/ipython  #!/usr/local/op ...

  6. Eclipse中导入项目后js报错解决方法

    http://blog.csdn.net/chenchunlin526/article/details/54666882 原因是因为开启了js的校验功能 不影响项目 如需去除错误标志按链接文档操作即可 ...

  7. Windows下同时安装了Python2与Python3时如何使用RobotFrameWork

    由于windows下不能像linux那样指定python文件的运行路径,当电脑中即安装了python2,又安装了python3时,也不能在环境变量中都配置运行路径吧(当然是可以配置的,系统会按照靠前的 ...

  8. eclipse java项目中明明引入了jar包 为什么项目启动的时候不能找到jar包 项目中已经 引入了 com.branchitech.app 包 ,但时tomcat启动的时候还是报错? java.lang.ClassNotFoundException: com.branchitech.app.startup.AppStartupContextListener java.lang.ClassN

    eclipse java项目中明明引入了jar包 为什么项目启动的时候不能找到jar包 项目中已经 引入了 com.branchitech.app 包 ,但时tomcat启动的时候还是报错?java. ...

  9. win7/8系统中php5.3和5.4、5.5不能加载php_curl.dll解决办法

    win7/8系统中php5.3和5.4.5.5不能加载php_curl.dll解决办法   作者:用户 来源:互联网 时间:2016-06-23 18:54:33 php变量注释系统模块 摘要: 本文 ...

随机推荐

  1. 关于 truncate table 的一点学习札记

    ---下面整理笔记来之 itpub 的各位前辈的语录.这里做了一个汇总.仅供学习. truncate table后,oracle会回收表和其表中所在的索引到initial 大小,也就是初始分配的seg ...

  2. CentOS笔记-用户和用户组管理

    Linux系统是一个多用户多任务的分时操作系统,任何一个要使用系统资源的用户,都必须首先向系统管理员申请一个账号,然后以这个账号的身份进入系统. 1.添加新的用户账号使用useradd命令,其语法如下 ...

  3. Python 中的字节与字节数组

    Python 中的字节与字节数组 - Python - 伯乐在线 http://python.jobbole.com/84839/

  4. SimpleHTTPServer

    SimpleHTTPServer python -m SimpleHTTPServer 8989

  5. amazon lightsail

    https://51.ruyo.net/6038.html https://aws.amazon.com/cn/lightsail/

  6. import data from excel to sql server

    https://www.c-sharpcorner.com/article/how-to-import-excel-data-in-sql-server-2014/ 需要注意的是,第一次是选择sour ...

  7. dedecms中去除首页index.html的方法

    本文介绍了dedecms中去除首页index.html的方法,有需要的朋友参考下. dedecms织梦cms建站程序输入地址后,而打开的实际地址后面有个index.html.   这里分享下两种解决方 ...

  8. UIFont 字体样式 [UIFont fontWithName~];

    设置字体样式代码:[UIFont fontWithName:@"Arial-BoldMT" size:15] 下边一一列举: 一:Font Family: American Typ ...

  9. [Java] 读取文件

    1.按字节读取文件内容2.按字符读取文件内容3.按行读取文件内容 4.随机读取文件内容 public class ReadFromFile { /** * 以字节为单位读取文件,常用于读二进制文件,如 ...

  10. SpringMVC上传多文件

    springMVC实现 多文件上传的方式有两种,一种是我们经常使用的以字节流的方式进行文件上传,另外一种是使用springMVC包装好的解析器进行上传.这两种方式对于实 现多文件上传效率上却有着很大的 ...