【问题标题】:Create windows executable using python setuptools使用 python setuptools 创建 windows 可执行文件
【发布时间】:2014-10-15 07:02:23
【问题描述】:

python setup.py bdist_windist

错误:

Warning: Can't read registry to find the necessary compiler setting
Make sure that Python modules _winreg, win32api or win32con are installed.   
error: [Errno 2] No such file or directory: '/usr/lib/python2.7/distutils/command/wininst-6.0.exe', /usr/lib/python2.7/distutils/command/wininst-6.0.exe not included in the Debian packages.

来自page的解决方案:

We cannot include the .exe files, because these are not built from source. Hint: copy these from the source package.

但是我在哪里可以找到要复制的那些 exe。

【问题讨论】:

    标签: python setuptools ubuntu-14.04


    【解决方案1】:

    您不能在 Debian/Linux 上创建 Windows .exe。您需要有一台安装了 Python 或 VM 的 Windows 机器。

    【讨论】:

    • 但是 setuptools 文档说它是可能的。行“这些安装程序甚至可以在 Unix 平台或 Mac OS X 上创建”来自docs.python.org/2/distutils/builtdist.html
    • 这曾经有效。 Precise (12.04) 包含必要的 wininst-6.0.exe 文件;见packages.ubuntu.com/precise-updates/amd64/python2.7-dev/…。但它已经从 Trusty (14.04) 中消失了。为什么?这使得构建 Windows exe 包成为不可能。
    • 我设法通过使用 distutils(来自C:\Python27\Lib\distutils\command\wininst-*.exe)的 Windows 机器复制 wininst-*.exe 到 Linux 端的相应目录来使其工作,然后它似乎能够构建.win32.exe.
    猜你喜欢
    • 2013-05-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-06-23
    • 2011-04-04
    相关资源
    最近更新 更多