在centos7上安装pip(3)的推荐方法 [英] Recommended way to install pip(3) on centos7
问题描述
我对知道在当前版本的centos7(7.5.1804)上安装用于python3.6的pip3的推荐方法(截至今天,2018年5月)和
I am interrested in knowing the recommended way to install pip3 for python3.6 (as of today, may 2018) on current version of centos7 (7.5.1804) and the accepted answer of How to install pip in CentOS 7? seems to be outdated because:
yum search -v pip
输出(除其他外):
python2-pip.noarch : A tool for installing and managing Python 2 packages
Repo : epel
python34-pip.noarch : A tool for installing and managing Python3 packages
Repo : epel
与
sudo yum install python34-setuptools
sudo yum install python34-setuptools sudo easy_install-3.4点 sudo easy_install-3.4 pip 但是由于我的机器上安装的python版本是2.7.5和3.6.3,为什么它是python34-pip而不是python36-pip? 3.4点(当前最新的3.6.3)中的pip是否相同? But since the versions of python installed on my machine are 2.7.5 and 3.6.3 why is it python34-pip and not python36-pip ? Is pip the same for 3.4+ (up to current 3.6.3) ? 对于3.4+点是相同的 Is pip the same for 3.4+ 不,不是.单个 No, it's not. A single 从Python 3.5开始, Since Python 3.5, Python 3.6在CentOS 7 vanilla repo中不可用.当需要在CentOS上安装新的Python时,我通常求助于 IUS存储库.它始终具有最新的Python版本,最新一个是3.6.5 .它还提供了相应的 Python 3.6 is not available in CentOS 7 vanilla repo. I usually resort to IUS repo when needing to install a fresh Python on CentOS. It always has the most recent Python version, the current one being 3.6.5. It also offers a correspondent 不幸的是,IUS 尚不提供适用于Python 3.7的软件包,因此如果您正在CentOS 7上寻找Python 3.7,从源代码构建是您唯一的选择. Unfortunately, IUS doesn't offer a package for Python 3.7 yet so if you are looking for Python 3.7 on CentOS 7, building from source is your only option.
您应该首选此答案中介绍的引导解决方案,因为它是获得有效的
You should prefer the bootstrapping solution described in this answer as it is the most reliable way to get a working 这篇关于在centos7上安装pip(3)的推荐方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
推荐答案
pip
安装可提供单个Python发行版(pip2.7
/pip3.4
/pip3.5
等). pip
installation serves a single Python distribution (pip2.7
/pip3.4
/pip3.5
etc). pip
已与python发行版捆绑在一起,因此您可以运行python3.6 -m pip
而不是pip
.pip
is already bundled with the python distribution, so you can just run python3.6 -m pip
instead of pip
.pip
包.pip
package.$ yum install https://centos7.iuscommunity.org/ius-release.rpm
$ yum install python36u python36u-devel python36u-pip
当
yum
不是选项时 when
yum
is not an optionpip
installed.