centos7 安装python3.6.1
centos7 安装python3.6
安装一下前置的文件
yum install openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel
yum install wget gcc make
这几个是工具
下载安装文件
wget https://www.python.org/ftp/python/3.6.1/Python-3.6.1.tgz
Mv Python-3.6.1.tgz /usr/local/Python3
./configure --prefix=/usr/local/python3
make
make install
- 并将/usr/local/python3/bin加入PATH
vim ~/.bash_profile
- PATH=$PATH:$HOME/bin:/usr/local/python3/bin
修改完记得执行行下面的命令,让上一步的修改生效:
source ~/.bash_profile
Python3及pip3是否正常可用:
python3 -V
Python 3.6.1
pip3 -V
pip 9.0.1 from /usr/local/python3/lib/python3.6/site-packages (python 3.6)
completed!!