本文主要是介绍编译 python 3.12,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
下载 python 源码,执行如下的命令:
export TCLTK_LIBS='-ltk8.6 -ltcl8.6'
export TCLTK_CFLAGS="-I/usr/include/tcl8.6"
./configure --prefix=/home/charles/install --with-pydebug --enable-shared --with-openssl=/home/charles/install/ --with-openssl-rpath=auto
make -j2
make install
因为系统预装的openssl 版本低,下载了一个新版本的openssl,然后在 configure 选项里指向安装的地址.
~$ python
Python 3.12.3 (main, May 1 2024, 16:16:21) [GCC 5.5.0 20171010] on linux
Type "help", "copyright", "credits" or "license" for more information.
参考:
Build Python 3.11 From Source With TLS/SSL on CentOS 7 | aikchar.dev
这篇关于编译 python 3.12的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!