Oracle 系统管理 - Linux 系统 - Backtrack 5 - 安全 - Juniper 技术 - Cisco 技术 - 思科模拟器 - Cisco 认证 - Cisco ios 下载

您现在的位置是:Docker > Jenkins > CentOS7 系统安装Python3.5

CentOS7 系统安装Python3.5

时间:2018-07-02 09:04  来源:未知  阅读次数: 复制分享 我要评论

2. 安装Python的依赖包

1
2
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的源码包并编译

1
2
3
4
5
6
7
8
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是否安装成功

1
python3 --version

3. 升级pip

因为python3.5自带pip,setuptools

1
2
/opt/python3.5/bin/pip3 install --upgrade pip
ln -s /opt/python3.5/bin/pip /usr/bin/pip

3. 升级setuptools

1
2
wget https://bootstrap.pypa.io/ez_setup.py -O - | python3
ln -s /opt/python3.5/bin/easy_install /usr/bin/easy_install

 

相关资讯