選擇Python版本://以Python3.7為例
#wget https://www.python.org/ftp/python/3.7.1/Python-3.7.1.tgz
2.1 解壓:tar xvf Python-3.7.1.tgz
2.2 配置:./configure --enable-optimizations
2.3 編譯:make -j8
安裝環境
# sudo apt install build-essential libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev zlib1g-dev -y
#sudo make install
#sudo rm /usr/bin/python3
#sudo ln -sf /usr/local/bin/python3.7 /usr/bin/python3
#sudo apt remove python3-apt
#sudo apt autoclean
#sudo apt install python3-apt
UnicodeEncodeError: gbk codec