为什么我无法在其他电脑上运行exe文件

发布于 2025-01-10 16:51:21 字数 677 浏览 3 评论 0原文

我用 tkinter 创建了一个应用程序。

该应用程序(python.py)包含一个按钮,通过单击该按钮它会调用脚本(我之前已经创建的脚本)并执行它们。

我能够使用 pyinstaller 将 python.py 转换为 python.exe (pyinstaller --onefile python.py) 在此步骤之后,我将 python.exe 和 pycache 以及我应该在应用程序中使用的所有脚本(扩展名为 py)放在一个文件夹中,并在 NSIS 中打开该文件夹......这样您就可以发送它对于在其他电脑上没有 python 的另一个用户

:应用程序打开,但一旦我单击按钮来执行脚本,我就会遇到错误

<块引用> <块引用>

没有找到python;不带参数运行以从 Microsoft 商店安装,或从“设置”>“禁用此快捷方式”管理应用程序执行别名。

我通过在管理应用程序执行别名上禁用应用程序 python 来修复它。 (不知道是否正确),但我尝试再次运行,出现此错误

python' 不被识别为内部或外部命令、可运行程序或批处理文件。

但我的电脑上一切正常,

知道我在 Windows 上工作,

也许我忘记了一步?

I had created with tkinter an application.

this application (python.py) contains a button, by clicking on the button it calls scripts (scripts that I have already created before) and executes them.

I was able to convert python.py to python.exe with pyinstaller (pyinstaller --onefile python.py)
after this step I put my python.exe and pycache and all the scripts (with extensions py) that I should use on my application in a single folder and open the folder in NSIS … so you can send it to another user who doesn't have python

On other pc : the application opens but as soon as I click on the button to have the execution of the scripts I have an error

python was not found; run without arguments to install from the Microsoft store, or disable this shortcut from settings > Manage App Execution Aliases.

I fix it with disable app python on manage app execution aliases. (I don’t know if it correct), but I tried to run it again and I have this error

python’ is not recognized as an internal or external command, operable program or batch file.

yet everything works fine on my pc

knowing that I work on windows

maybe i forgot a step?

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

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

发布评论

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

评论(1

仙女山的月亮 2025-01-17 16:51:21

目标 PC 上未安装 Python 解释器。将您的可执行文件与在任何 Windows PC 上运行应用程序所需的所有依赖库捆绑在一起。另请注意,您的 Windows 版本也很重要。

Python interpreter is not installed on the target PC. Bundle your executable with all dependency libraries necessary to run your application on any windows PC. Also note that your windows version matters too.

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