安装python依赖环境
# 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
安装python
wget https://www.python.org/ftp/python/3.6.6/Python-3.6.6.tgz
创建目录并解压
mkdir /usr/local/python3.6
find / |grep Python-3.6.6.tgz
mv /root/Python-3.6.6.tgz /usr/local/python3.6/
tar -zxvf Python-3.6.6.tgz
编译安装
yum install gcc
cd Python-3.6.6
./configure --prefix=/usr/local/python3.6
make
make install
建立软连接
ln -s /usr/local/python3.6/bin/python3 /usr/bin/python3
添加path
vi ~/.bash_profile
source ~/.bash_profile
查看结果
python3 -v 注意直接输入python是centos自带python2.7
pip3 -v pip3是python无脑下载第三方模块的软件
版权声明:本文原创发表于 博客园,作者为 本文欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则视为侵权。