Skip to main content
 首页 » 编程设计

python之使用 python setuptools 创建 Windows 可执行文件

2025年05月04日8jackei

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。

请您参考如下方法:

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