py2exe导入错误

发布于 2025-01-06 14:30:37 字数 531 浏览 7 评论 0原文

我阅读了 py2exe 教程并成功将我的 python 代码转换为正在运行的可执行文件。

但是当我尝试在另一台没有安装 python 的计算机上运行它时,出现以下错误:

回溯(最近一次调用最后一次):
文件“C:\Program_Files\Pyton2_7_2\lib\site-packages\py2exe\boot_common.py”,第 92 行,位于 导入错误:没有名为 linecache 的模块
回溯(最近一次调用最后一次):
文件“auto_create_workspace.py”,第 1 行,位于 导入错误:没有名为 subprocess 的模块

在我的电脑上,即使我卸载了 python,它仍然可以工作。

更新 我尝试将 dist 文件夹复制到计算机上的另一个驱动器,但它仍然有效。 当我将其复制到网络驱动器并从那里运行时,我收到与上面相同的错误。

可能是什么问题?

I read the py2exe tutorial and successfully convert my python code to a running exectuable.

But when i tried to run it on another computer that dont have python installed , i get the following error:

Traceback (most recent call last):
File "C:\Program_Files\Pyton2_7_2\lib\site-packages\py2exe\boot_common.py", line 92, in
ImportError: No module named linecache
Traceback (most recent call last):
File "auto_create_workspace.py", line 1, in
ImportError: No module named subprocess

On my computer , even if I uninstalled python , it still works.

UPDATE
I tried to copy the dist folder to another drive on my computer and it still working.
When I copy it to network drive and run from there , I get the same error as above.

What can be the problem?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

z祗昰~ 2025-01-13 14:30:37

我仍然不知道 py2exe 中的问题是什么,所以我尝试了 pyinstaller ,它的工作原理

I still dont know what is the problem in py2exe, so I tried pyinstaller instead and its works

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文