cenos安装Python3

版权声明:原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 、作者信息和本声明。否则将追究法律责任。 https://blog.csdn.net/kucoll/article/details/81592678

1: 安装必要的开发工具库

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
expat-devel gcc gcc-c++

2:下载对应的python源码

wget https://www.python.org/ftp/python/3.6.3/Python-3.6.3.tar.xz

3:安装python(将下载的源代码移到/usr/local/python3目录)

mkdir /usr/local/python3 

mv Python-3.6.3.tar.xz /usr/local/python3/

tar -xvJf Python-3.6.3.tar.xz

cd Python-3.6.3 && ./configure --prefix=/usr/local/python3 --with-ssl --with-zlib

make && make install

4:建立软链接

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

文章参考:https://www.cnblogs.com/FZfangzheng/p/7588944.html

阅读更多
想对作者说点什么?

博主推荐

换一批

没有更多推荐了,返回首页