ubuntu 22.04 jammy 手动安装 python 3.6

1 准备编译器

sudo apt-get install -y make build-essential libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev \
libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev \
libgdbm-dev libnss3-dev libedit-dev libc6-dev

2 下载 python 3.6,并解压

wget https://www.python.org/ftp/python/3.6.15/Python-3.6.15.tgz

tar -xzf Python-3.6.15.tgz

3.编译

cd Python-3.6.15
./configure --enable-optimizations  -with-lto  --with-pydebug
make -j 8  # adjust for number of your CPU cores
sudo make altinstall

4.查看

python3.6 -V

参考
https://stackoverflow.com/questions/72102435/how-to-install-python3-6-on-ubuntu-22-04
https://cloud.tencent.com/developer/ask/sof/106928733

你可能感兴趣的:(Linux,笔记,1024程序员节)