编译完后要跑自带的测试集看编译是否正确的,越老的 python 版本越难静态编译
不然去 github 上找一个别人配置好的静态编译工程
我也静态编译过 Python3.10 但是不能完整的过测试集
$ ldd build/bin/python3.10
not a dynamic executable
$ file build/bin/python3.10
build/bin/python3.10: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked, BuildID[sha1]=546463ab44b360fbe42e38f843548bbfc6ce4d61, for GNU/Linux 3.2.0, with debug_info, not stripped
$ ./build/bin/python3.10 -m pip install --upgrade pip
Looking in indexes:
https://mirrors.cloud.aliyuncs.com/pypi/simple/Requirement already satisfied: pip in ./build/lib/python3.10/site-packages (21.2.4)
Collecting pip
Downloading
https://mirrors.cloud.aliyuncs.com/pypi/packages/d4/55/90db48d85f7689ec6f81c0db0622d704306c5284850383c090e6c7195a5c/pip-24.2-py3-none-any.whl (1.8 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.8/1.8 MB 21.1 MB/s eta 0:00:00
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 21.2.4
Uninstalling pip-21.2.4:
Successfully uninstalled pip-21.2.4
Successfully installed pip-24.2