Self-contained highly-portable Python distributions
摘要
本文档介绍 Python Standalone Builds 项目,提供自包含、高度可移植的 Python 发行版,尽量降低运行时依赖(限制 CPU 指令和共享库),目标是在目标架构的任何系统上运行。部分发行版附带构建产物和元数据,可供下游重新打包(如去除 SQLite、OpenSSL),也提到 PyOxidizer / PyOxy 姊妹项目。文档还列出获取、解压、运行要求、构建方式、平台差异(如 Linux 上无 tix、Windows 无 pip.exe)、技术原理和已知问题等章节。
荐读理由
这份文档把自包含、可移植的 Python 发行版讲透了:标准库依赖要么随包分发要么静态链接,目标架构上开箱即用,还附 PyOxidizer 做单文件解释器,你打包部署 AI 服务时能直接拿来省掉环境依赖的坑
原文
Python Standalone Builds¶
This project produces self-contained, highly-portable Python distributions. These Python distributions contain a fully-usable, full-featured Python installation: most extension modules from the Python standard library are present and their library dependencies are either distributed with the distribution or are statically linked.
The Python distributions are built in a manner to minimize run-time dependencies. This includes limiting the CPU instructions that can be used and limiting the set of shared libraries required at run-time. The goal is for the produced distribution to work on any system for the targeted architecture.
Some distributions ship with their build artifacts (object files, libraries, etc) along with rich metadata describing the distribution and how it was assembled. The build artifacts can be recombined by downstream repackagers to derive a custom Python distribution, possibly without certain features like SQLite and OpenSSL. This is useful for embedding Python in a larger binary. See the PyOxidizer sister project for such a downstream repackager.
Many users of these distributions might be better served by the PyOxy sister project. PyOxy takes these Python distributions and adds some Rust code for enhancing the functionality of the Python interpreter. The official PyOxy release binaries are single file executables providing a full-featured Python interpreter.
Contents:
Indices and tables¶
这条对你有帮助吗?