当前位置: 首页 >> Linux >> 【安装】CentOS7安装Python3.5 >> 正文

【安装】CentOS7安装Python3.5

2019年05月17日 15:19:54    作者:Jiaozn    分类:Linux     评论(0)

1. 安装Python的依赖包

yum -y groupinstall "Development tools"

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


2. 下载Python3.5的源码包并编译

cd /usr/local/src

wget https://www.python.org/ftp/python/3.5.1/Python-3.5.1.tgz

tar -zxf /usr/local/src/Python-3.5.1.tgz && cd Python-3.5.1

./configure --prefix=/opt/python3.5 --enable-shared

make && make install

ln -s /opt/python3.5/bin/python3 /usr/bin/python3

echo "/opt/python3.5/lib" > /etc/ld.so.conf.d/python3.5.conf

ldconfig

检测python3.5是否安装成功

python3 --version


3. 升级pip

因为python3.5自带pip,setuptools

/opt/python3.5/bin/pip3 install --upgrade pip

ln -s /opt/python3.5/bin/pip /usr/bin/pip


4. 升级setuptools

wget https://bootstrap.pypa.io/ez_setup.py -O - | python3

ln -s /opt/python3.5/bin/easy_install /usr/bin/easy_install


除非注明,发表在“Jiaozn的博客”的文章『【安装】CentOS7安装Python3.5』版权归Jiaozn所有。 转载请注明出处为“本文转载于『Jiaozn的博客』原地址https://jiaozn.com/reed/452.html

评论

发表评论   

昵称*

E-mail*

网站