问题标签 [py2exe]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
4 回答
30364 浏览

python - py2exe 有什么替代品吗?

py2exe 有什么替代品吗?

0 投票
4 回答
2561 浏览

python - python应用程序到exe在WinSRV2003上不起作用

我创建了一个小应用程序,用于在服务器出现问题时发送电子邮件。使用 py2exe 创建 exe 文件。虽然它在 Win7 上运行得非常好,但在 WinSRV2003 上运行它时遇到问题。我不相信它与代码本身有关。请参阅下面的导入

setup.py 文件:

还有 py2exe 输出中的一行可能很有趣

以下模块似乎缺少 ['_scproxy']

尝试启动时的错误消息:

此应用程序无法启动,因为应用程序配置不正确。重新安装应用程序可能会解决此问题。

我想到的是它是否会丢失一些允许应用程序运行的注册表项?

0 投票
4 回答
868 浏览

python - 任何可以静态链接python2x.dll依赖项的python“编译器”?

据我了解,py2exe 只能动态链接 python2x.dll 文件。是否有任何 Python“编译器”可以将它们全部打包到一个独立的 .exe 文件中以便于移植?

如果是或者如果不是,最好的编译器是z0mg!

0 投票
2 回答
7417 浏览

python-3.x - 为 Python 3 和 PyQt 构建可执行文件

我使用 PyQt4 在 Python 3.1 中构建了一个相当简单的应用程序。完成后,我希望将应用程序分发到没有安装任何一个的计算机上。

我几乎只关心 Windows 平台,所以我的目标是最终拥有一个可执行文件以及一些资源文件和 .dll。

搜索了一圈,我得出的结论是

  • py2exe仅支持 Python 至 2.7 版本
  • pyinstaller仅支持 Python 至 2.6 版本
  • cx_Freeze对我不起作用,因为我在尝试执行成功构建的二进制文件时不断收到以下错误:

所以我的问题基本上是这里的两个问题:

  1. 除了 cx_Freeze 之外,还有其他方法可以使用我的配置构建二进制文件吗?
  2. 如果不是,cx_Freeze 问题可能是什么?

如有必要,我可以提供有关第二个问题的更多信息,例如我对 cx_Freeze 的调用、我的 distutils 设置脚本等。

已经感谢您的帮助和评论。

0 投票
1 回答
116 浏览

python - reactor.iterate 似乎用 Py2exe 阻止了一个程序

我目前在 python 中使用一个运行良好的应用程序,但是当我用 py2exe 转换它时,应用程序似乎在第一个“reactor.iterate”处暂停

每次我按 Ctrl+C 停止应用程序时,错误总是相同的,应用程序似乎被“reactor.iterate(4)”阻塞

普通的 python 解释器永远不会出现这个问题。

你有想法吗?

0 投票
2 回答
961 浏览

python - py2exe 和电子邮件库再次

以下进口:

在 Python2.6 中使用 py2exe 创建 exe 时可以正常工作,但在 Python2.5 中不能

以下模块似乎缺少 ['email.Encoders', 'email.Generator', 'email.Iterators', 'email.MIMEText', 'email.Utils', 'email.base64MIME']

安装程序.py:

我以为我解决了一个问题,但不幸的是我必须尝试 python2.5。

0 投票
2 回答
4098 浏览

python - Python Windows Service Problems - Works when using debug argument but not while started as a service?

hopefully someone here can shed some light on my issue :D

I've been creating a Windows XP service in python that is designed to monitor/repair selected Windows/Application/Service settings, atm I have been focusing on default DCOM settings.

The idea is to backup our default configuration within another registry key for reference. Every 30 minutes (currently every 30 seconds for testing) I would like the service to query the current windows default DCOM settings from the registry and compare the results to the default configuration. If discrepancies are found, the service will replace the current windows settings with the custom configuration settings.

I have already created/tested my class to handle the registry checking/repairing and so far it runs flawlessly.. Until I compile it to an exe and run it as a service.

The service itself starts up just fine and it seems to loop every 30 seconds as defined, but my module to handle the registry checking/repairing does not seem to get run as specified.

I created a log file and was able to obtain the following error:

Traceback (most recent call last):
File "DCOMMon.pyc", line 52, in RepairDCOM
File "DCOMMon.pyc", line 97, in GetDefaultDCOM
File "pywmi.pyc", line 396, in call
File "pywmi.pyc", line 189, in handle_com_error
x_wmi: -0x7ffdfff7 - Exception occurred.
Error in: SWbemObjectEx
-0x7ffbfe10 -

When I stop the service and run the exe manually, specifying the debug argument: DCOMMon.exe debug, the service starts up and runs just fine, performing all tasks as expected. The only differences that I can see is that the service starts the process as the SYSTEM user instead of the logged on user which leads me to believe (just guessing here) that it might be some sort of missed permission/policy for the SYSTEM user? I have tested running the service as another user but there was no difference there either.

Other thoughts were to add the wmi service to the dependencies of my service but truthfully I have no idea what that would do :P This is the first time I've attempted to create a windows service in python, without using something like srvany.exe.

I have spent the better part of last night and today trying to google around and find some information regarding py2exe and wmi compatibility but so far the suggestions I have found have not helped solve the above issue.

Any suggestions would be appreciated.

PS: Don't hate me for the poor logging, I cut/pasted my logger from a different scripts and I have not made the appropriate changes, it might double up each line :P. The log file can be found here: "%WINDIR%\system32\DCOMMon.log"

UPDATE

I have tried to split this project up into two exe files instead of one. Let the service make and external call to the other exe to run the wmi registry portion. Again, when running with the debug arg it works just fine, but when I start it as a service it logs the same error message. More and more this is starting to look like a permission issue an not a program issue :(

UPDATE

DCOMMon.py - Requires pywin32, wmi (renamed to pywmi),

DCOMMon_setup.py - Requires py2exe (self executable, no need for py2exe arg)

0 投票
1 回答
2263 浏览

python - Python py2exe - 内存加载错误

我正在用 Python 创建一个中级应用程序。现在一切正常,我正在尝试使用 py2exe 使其成为 Windows 可执行文件。可执行文件创建得很好,但是当我尝试运行它时,它失败并出现以下错误。

我在这个应用程序中使用 pyAA。我搜索了互联网,但无法获得任何解决方案。我将 msvcp71.dll 复制到 windows/system32,但问题仍然存在。

我早些时候(大约 7 个月前)解决了它,但是我的硬盘崩溃了,当我尝试重新创建它时,我现在似乎无法解决它。:-(

如果有人可以在这里帮助我,我将非常感激。

编辑:当我使用没有捆绑文件选项的 py2exe 时,它​​运行良好。但是当我使用捆绑文件选项时,它失败了。

我尝试不使用 zipfile 选项,其中它创建了一个 library.zip 以及可执行文件。又失败了。我使用 7-zip 解压缩了 library.zip,发现 _pyAAc.pyd 位于 zip 文件内的 pyAA 文件夹中。因此,它看起来像是 memoryloadlibrary 函数的一些问题。

当我尝试使用 Windows 解压缩功能解压缩时,它失败了。我不得不使用 7-zip 解压缩它。这是一个可能的线索吗?

0 投票
2 回答
4201 浏览

python - 从 Django 应用程序制作 Windows 可执行文件

我正在尝试使 Django 网站成为一个简单的 Windows 可执行文件。有人告诉我py2exe,由于 Django 使用__import__,以及它试图以manage.py某种晦涩的方式调度,它不能正常工作。是这样吗?如果是这样,是否有更好的替代工具,或者有没有办法解决这些py2exe问题?

0 投票
2 回答
1981 浏览

python - 使用 py2exe 构建带有扩展名的 python 程序

我很难找到 py2exe 配方,尤其是对于需要 c 扩展的情况。

以下配方在没有“ext_modules”部分的情况下可以正常工作。有了它,我得到“NameError:未定义名称'Extension'。

_classifier.c 包括以下内容

任何帮助将不胜感激。