1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
sudo apt-get install aptitude sudo aptitude -y install gcc make zlib1g-dev libffi-dev libssl-dev
if [ ! -d "/opt/software" ] then mkdir -p /opt/software fi
cd /opt/software
version=3.12.3 short_version=3.12
wget https://mirrors.aliyun.com/python-release/source/Python-${version}.tar.xz echo "解压 ..." xz -d Python-${version}.tar.xz tar -xf Python-${version}.tar cd Python-${version}
sudo ./configure --prefix=/usr/local/python3 --with-ssl --enable-optimizations
sudo make && make altinstall ln -s /usr/local/python3/bin/python${short_version} /usr/bin/python3 ln -s /usr/local/python3/bin/pip${short_version} /usr/bin/pip3
|