# Download the source package to`opt`table of Contents
wget -c -P /opt https://www.python.org/ftp/python/3.8.0/Python-3.8.0.tar.xz
# Unzip
tar - xvf Python-3.8.0.tar.xz
cd Python-3.8.0
# Update system
apt-get update
apt-get upgrade
apt-get dist-upgrade
# Install dependent libraries
apt-get install libbz2-dev libncurses5-dev libgdbm-dev libgdbm-compat-dev liblzma-dev libsqlite3-dev libssl-dev openssl tk-dev uuid-dev libreadline-dev python-dev
. /configure --enable-optimizations --enable-shared
make -j8
make altinstall
python3.8
# python3.8: error while loading shared libraries: libpython3.8.so.1.0: cannot open shared object file: No such file or directory
Configure the dynamic link library path
vim ~/.profile
# Append
export LD_LIBRARY_PATH="/usr/local/lib"
alias python="/usr/local/bin/python3.8"
alias python3.8="/usr/local/bin/python3.8"
# Update
source ~/.profile
The test is successful again!
Recommended Posts