我无法在其他桌面上打开我的EXE文件
我在Pycharm上完成了代码。现在我想将.py文件转换为.exe 我转换后。应用程序文件正在我用来转换的桌面(Desktop1)上运行,但是当我尝试在其他桌面上打开应用程序时,它会有一个错误。
`Traceback (most recent call last):
File "main.py", line 220, in <module>
obj = DocumentsManagementSystem(root)
File "main.py", line 20, in __init__
self.root.iconbitmap(r'C://Users//HP//PycharmProjects//pythonProject1//Images//senglogo.ico')
File "tkinter\__init__.py", line 2109, in wm_iconbitmap
_tkinter.TclError: bitmap "C://Users//HP//PycharmProjects//python`
但是,当我在桌面上打开它时,它正在运行。这就是问题。我无法在其他桌面上打开它。如果您对如何解决这个问题有任何了解。我很乐意这样做。太感谢了!
I finished my code on Pycharm. Now I want to convert my .py file into .exe
After i converted it. The application file are running on the desktop (desktop1) that I used to convert, but when i try to open the application on other desktop (desktop2) it has an error that says.
`Traceback (most recent call last):
File "main.py", line 220, in <module>
obj = DocumentsManagementSystem(root)
File "main.py", line 20, in __init__
self.root.iconbitmap(r'C://Users//HP//PycharmProjects//pythonProject1//Images//senglogo.ico')
File "tkinter\__init__.py", line 2109, in wm_iconbitmap
_tkinter.TclError: bitmap "C://Users//HP//PycharmProjects//python`
but when i open it on the desktop (desktop1) it is running. That's the issue. I cannot open it on other desktop. If you have any idea on how i can solve this. I will gladly do it. Thank you so much!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将Pyinstaller与其他文件和add-data参数一起使用。在您的情况下,请使用此命令:
似乎您错过了在Pyinstaller流程中添加附加和数据文件。
如果您是初学者,则可以使用Pytinstaller的GUI。
PY exe所需的步骤。
分析:查找您的程序需求的文件
https> https:https:// pyinstaller。 org/en/stable/procer-mode.html#分析finding-the-finding-files-your-program-needs
使用此命令添加所需的文件:
Use pyinstaller with additional file and add-data parameters. In your case use this command:
It seems like you missed adding an additional and data file in your pyinstaller process.
if you're beginner you can use the GUI of pytinstaller.
https://pypi.org/project/auto-py-to-exe/
The required steps for py to exe.
Analysis: Finding the Files Your Program Needs
https://pyinstaller.org/en/stable/operating-mode.html#analysis-finding-the-files-your-program-needs
Add required file by using this command: