sudo apt-get install zlib1g-dev libbz2-dev libssl-dev libncurses5-dev libsqlite3-dev
libreadline-dev tk-dev libgdbm-dev libdb-dev libpcap-dev xz-utils libexpat1-dev
liblzma-dev libffi-dev libc6-dev
wget https://www.python.org/ftp/python/3.7.4/Python-3.7.4.tgz
tar zxvf Python-3.7.4.tgz
cd Python-3.7.4/
sudo mkdir -p /usr/local/python3
./configure --prefix=/usr/local/python3 --enable-optimizations
make
sudo make install
which python3
which pip3
rm -rf /usr/bin/python3
rm -rf /usr/bin/pip3
#添加python3的软链接
ln -s /usr/local/python3/bin/python3.7 /usr/bin/python3
#添加 pip3 的软链接
ln -s /usr/local/python3/bin/pip3.7 /usr/bin/pip3
python3 -V
pip3 -V
subprocess.CalledProcessError: Command ‘(‘lsb_release’, ‘-a’)’ returned non-zero exit status 1.
解决方法
find / -name lsb_release
rm -rf /usr/bin/lsb_release
网友评论