看了很多从源码编译的Python 3.10安装方法,但是很多都没有完整写下来安装所需要的系统依赖,所以导致后续使用诸多不便,在此以Debian系为例记录一下:
sudo apt-get install 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 libgdbm-compat-dev
./configure --with-openssl=/usr --enable-optimizations --prefix=/usr/local/python3.10 make sudo make install
注意,这里的openssl用的是系统自带的,所以openssl的root是/usr