Python3与Python2共存-Centos7-Python


一.安装依赖包与工具

yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make 
yum install libffi-devel -y

二.下载Python安装包
国内淘宝镜像:Python Mirror (taobao.org)

wget http://npm.taobao.org/mirrors/python/3.9.7/Python-3.6.6.tar.xz

三.编译安装
解压

tar -xvJf  Python-3.6.6.tar.xz
cd Python-3.6.6
./configure prefix=/usr/local/python3
make && make install

创建软链接

ln -s /usr/local/python3/bin/python3 /usr/bin/python3
ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3

升级pip3

pip3 install --upgrade pip

暂无评论

发送评论 编辑评论


				
上一篇
下一篇