下载python3.9.12.tgz,解压。然后进入目录。
配置:./configure --prefix=/usr/local/python
编译:make
make 之后报错:
/usr/local/src/Python-3.9.12/Modules/_ctypes/_ctypes.c:107:17: fatal error: ffi.h: No such file or directory
#include <ffi.h>
^
compilation terminated.
Python build finished successfully!
The necessary bits to build these optional modules were not found:
_bz2 _curses _curses_panel
_dbm _gdbm _hashlib
_lzma _sqlite3 _ssl
_tkinter _uuid readline
zlib
To find the necessary bits, look in setup.py in detect_modules() for the module's name.
The following modules found by detect_modules() in setup.py, have been
built by the Makefile instead, as configured by the Setup files:
_abc