首页 首页 >  文章资讯

centos 安装 Pip 的方法总结

发布时间:2023-08-12 09:59:22 浏览次数:109次

在我们安装Python后,如果未安装包管理工具pip,此时需要自己手动安装:

方式1(yum安装):
1、首先安装epel扩展源:
[root@localhost ~]#  yum -y install epel-release
如果没有安装epel扩展源而直接安装python-pip时,会出现找到该软件包的错误。
这是因为像centos这类衍生出来的发行版,他们的源有时候内容更新的比较滞后,或者说有时候一些扩展的源根本就没有。
2、安装pip
[root@localhost ~]#  yum -y install  python-pip
3、更新pip
[root@localhost ~]#  pip install --upgrade pip
4、安装后清除cache
[root@localhost ~]#  yum clean all

方式2(源码安装):
[root@localhost ~]#  wget --no-check-certificate https://github.com/pypa/pip/archive/1.5.5.tar.gz
注意:wget获取https的时候要加上:--no-check-certificate
[root@localhost ~]#  tar zvxf 1.5.5.tar.gz    #解压文件
[root@localhost pip-1.5.5]#  cd pip-1.5.5/
[root@localhost pip-1.5.5]#  python setup.py install

方式3(get-pip安装):
[root@localhost ~]#  curl https://bootstrap.pypa.io/get-pip.py | python

转载于:https://www.cnblogs.com/xubing-613/p/9520478.html



【版权与免责声明】如发现内容存在版权问题,烦请提供相关信息发邮件至 lnkj@3173.top ,我们将及时沟通与处理。 本站内容除了3117站长服务平台( www.3117.cn )原创外,其它均为网友转载内容,涉及言论、版权与本站无关。