Ubuntu 18.04 + Python2.7 安裝 Python3.4.0
阿新 • • 發佈:2020-12-15
- 準備
apt-get install build-essential checkinstall
apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev
- 下載
wget https://www.python.org/ftp/python/3.4.0/Python-3.4.0.tgz
tar xzf Python-3.4.0.tgz
- 安裝
將python3.4.0移動至/usr/bin/
cp python3.4 /usr/bin/
./configure --enable-shared
make
make install
- 更新一下替代列表,將 python2.7 和 python3.4 放入其中
update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1
update-alternatives --install /usr/bin/python python /usr/bin/python3.4 2
- 確認
檢視python版本
python -V
- 錯誤
apt-get install libssl-dev
apt-get install openssl