具体怎么装置,能够参考:Ubuntu20.04 从源代码编译装置 python3.10
在 ubuntu22.04 上,我曾经从源码编译装置了多个 python 了:3.7、3.8、3.9、3.11
╭─pon@amd5700g ~
╰─➤ cd ~/opt/python/cpython/
╭─pon@amd5700g ~/opt/python/cpython
╰─➤ ll
inode Permissions Links Size Blocks User Group Date Modified Name
17728017 drwxrwxr-x 6 - - pon pon 2 5 月 01:25 python3.7
16261056 drwxrwxr-x 6 - - pon pon 14 1 月 19:34 python3.8
16275536 drwxrwxr-x 6 - - pon pon 14 1 月 19:34 python3.9
16663293 drwxrwxr-x 6 - - pon pon 5 2 月 21:32 python3.11