<p>所有值得注意的linux发行版和macos都附带了一些Python版本。Windows在默认情况下没有安装Python,因此必须单独安装才能运行Python模块。当然,安装的Python版本必须与您的程序(版本2或3)相同。在</p>
<p>分发程序最简单的方法是只分发源代码(例如,通过电子邮件发送模块或将其上载到某个地方),但在这种情况下,目标PC必须安装Python<strong>并满足依赖关系。一个更好的解决方案(至少对于社区来说)是将程序作为包上传到<a href="http://pypi.python.org/pypi" rel="nofollow noreferrer">PyPi</a>上。有关该过程的更多信息可以在<a href="http://packages.python.org/an_example_pypi_project/index.html" rel="nofollow noreferrer">HERE</a>中找到。在</p>
<p>在某些情况下,有一些原因阻止您使用这些选项。例如,您不能安装python和/或依赖项(没有root/admin帐户)。如果是这种情况,您可以将模块与运行程序所需的所有其他东西捆绑在一起(例如,在windows上的python*.dll)。据我所知,这种分配的基本选择如下:</p>
<ol>
<li><a href="http://www.pyinstaller.org/" rel="nofollow noreferrer">PyInstaller</a></li>
<li><a href="https://github.com/pybee/briefcase" rel="nofollow noreferrer">briefcase</a></li>
<li><a href="https://github.com/mherrmann/fbs" rel="nofollow noreferrer">fbs</a></li>
<li><a href="https://github.com/indygreg/PyOxidizer" rel="nofollow noreferrer">PyOxidizer</a></li>
<li><a href="http://nuitka.net/posts/support-for-portable-standalone-programs.html" rel="nofollow noreferrer">nuitka standalone</a></li>
<li><a href="https://py2app.readthedocs.io/en/latest/" rel="nofollow noreferrer">py2app</a>(仅适用于Mac OS)</li>
<li><a href="http://cx-freeze.sourceforge.net/" rel="nofollow noreferrer">cx_Freeze</a></li>
<li><a href="http://wiki.python.org/moin/Freeze" rel="nofollow noreferrer">freeze</a></li>
<li><p><a href="http://www.py2exe.org/" rel="nofollow noreferrer">py2exe</a></p></li>
<li><p><a href="https://github.com/cython/cython/wiki/EmbeddingCython" rel="nofollow noreferrer">cython embed</a></p></li>
</ol>
<p>另一种方法是使用<a href="http://www.portablepython.com/" rel="nofollow noreferrer">Portable Python</a>,或者对于Linux/BSD <a href="http://code.google.com/p/pts-mini-gpl/wiki/StaticPython" rel="nofollow noreferrer">StaticPython</a></p>
<p>注意:并非所有上述工具都在所有平台上运行或/并支持Python3。检查他们的文件。在</p>
<h2>未维护的</h2>
<ol>
<li><a href="http://pypi.python.org/pypi/bbfreeze/0.97.2" rel="nofollow noreferrer">bbFreeze</a></li>
<li><a href="https://github.com/cloudmatrix/esky/" rel="nofollow noreferrer">esky</a>(未维护)</li>
<li><a href="http://www.riverbankcomputing.co.uk/software/vendorid/intro" rel="nofollow noreferrer">vendorID</a></li>
<li><a href="http://code.google.com/p/gui2exe/" rel="nofollow noreferrer">gui2exe</a></li>
</ol>