Python3 在CentOS7上使用镜像源方式yum进行安装

11 篇文章 1 订阅

ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

安装epel源扩展

# 安装epel源扩展
[root@localhost~]$ yum install epel-release -y
# ..........


epel源安装 python3 python3-devel

# epel源已经更新到python3.6.8版本
[root@localhost~]$ yum install python3 python3-devel -y     
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.cn99.com
 * epel: mirrors.aliyun.com
 * extras: mirrors.cn99.com
 * updates: mirrors.aliyun.com
Resolving Dependencies
--> Running transaction check
---> Package python36.x86_64 0:3.6.8-1.el7 will be installed
--> Processing Dependency: python36-libs(x86-64) = 3.6.8-1.el7 for package: python36-3.6.8-1.el7.x86_64
--> Processing Dependency: libpython3.6m.so.1.0()(64bit) for package: python36-3.6.8-1.el7.x86_64
# ..........

安装Python2 和 Python3 的pip工具并更新

# 安装Python2 和 Python3 的pip工具并更新到最新版本
[root@localhost~]$ curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && python3 get-pip.py && python get-pip.py
# ..........
# 或者 
[root@localhost~]$ curl https://bootstrap.pypa.io/pip/2.7/get-pip.py -o get-pip.py && python get-pip.py

pip3安装requests包

[root@localhost~]$ pip install request
# ..........
[root@localhost~]$ pip3 install request
# ..........

安装python-pip

yum install python-pip

升级pip

pip install --upgrade pip
python -m pip install --upgrade pip
pip3 install --upgrade pip3
python3 -m pip3 install --upgrade pip3

其他更新

python -m pip install --upgrade setuptools
python3 -m pip3 install --upgrade setuptools
 pip3 install --upgrade setuptools

清除yum的缓存cache

yum clean all
  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值