20200831 更新
好久没有编译, 几乎忘了命令和踩过的坑, 来看自己的笔记发现也没有. 真是.以后还是要多笔记一下
先安装一堆依赖
yum install gdbm-devel tk-devel xz-devel sqlite-devel readline-devel bzip2-devel ncurses-devel zlib=devel
当然gcc也是要的.
yum install gcc*
./configure --prefix=/usr/local/python3.8.5--enable-optimizations --with-ensurepip=install
./configure prefix=/usr/local/python3.7.9 --enable-shared
#--enable-optimizations 会很慢, 如果不是生产环境, 就调过这一步吧.
#--with-ensurepip=install
#--enable-shared 这个是解决一堆编译错误的
https://www.everkb.com/article/en/failed-to-build-these-modules-_ctypes-when-installing-python-3-on-centos-7
make -j 8
make altinstall
#有一步过不去, 最后 yum install zlib-devel 就好了
shell中设置代理的配置点:
export http_proxy=http://xxxx:80/
export ftp_proxy=http://xxxx:80/
export socks_proxy=socks://xxxx:80/
export https_