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

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

你可能感兴趣的:(Python,Linux,bash,linux,centos,python)