linux compile and install Python3.6 (retains its own Python2)

yum install wget
yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel


cd /usr/local/src
wget https://www.python.org/ftp/python/3.6. 0/Python-3.6.0.tgz
tar -zxf /usr/local/src/Python-3.6.0.tgz && cd Python-3.6.0


mkdir /usr/local/python3
./configure --prefix=/usr/ local/python3
make && make altinstall


# The key step is to establish a link
ln -s /usr/local/python3/bin/python3.6 /usr/bin/python3 # You can use "python3" directly
ln -s /usr/local/python3 /bin/pip3.6 /usr/bin/pip3 # You can use "pip3" directly


# Finally test
python3
pip3

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327097327&siteId=291194637