当前位置:   article > 正文

python3.7.4安装pip_centos7 安装pip+python3.7

centos python 3.7.4对应的 pip3 的 rpm 包

cd /usr/local/src

2.安装依赖包:yum -y groupinstall "Development tools"

yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel

3.在/usr/local/src目录下wget https://www.python.org/ftp/python/3.7.3/Python-3.7.3.tgz

4.在/usr/local/python3目录下tar -xvf Python-3.7.3.tgz

cd Python-3.7.3

./configure --prefix=/usr/local/python3

make && make install

关于在centos下安装python3.7.0以上版本时报错ModuleNotFoundError: No module named '_ctypes'的解决办法yum install libffi-devel -y

5.切换到/usr/bin/目录下mv python python.bak

mv pip pip.bakln -s /usr/local/python3/bin/python3 /usr/bin/pythonln -s /usr/local/python3/bin/pip3 /usr/bin/pip

6.防止以后用yum源安装软件时,报错

vi /usr/bin/yum

输入i,把文件开头第一行的

#!/usr/bin/python改成#!/usr/bin/python2.7

vi /usr/libexec/urlgrabber-ext-down

输入i,把文件开头第一行的

#!/usr/bin/python改成#!/usr/bin/python2.7

7.验证

输入python,进入python3.6.2

输入python2,进入python2.7

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/AllinToyou/article/detail/212050
推荐阅读
相关标签
  

闽ICP备14008679号