简体   繁体   中英

exe generated by pyinstaller doesn't work as expected

I use pyinstaller to convert my py to exe. It contains a UI written by tkinter.

pyinstaller -F my_tool.py

The exe runs normally on my own computer (UI appears in 1-2 min), but when I send it to others, it takes very long time (>15min) to display the UI.

I have no idea of why this happens and how to make the exe respond quickly in other computers. Does anyone know how to deal with it?

---Edit---

I found some warnings in the log and I'm wondering whether the warnings impact the exe:

62194 WARNING: Hidden import "importlib_resources.trees" not found!
62446 WARNING: Conda distribution 'numpy', dependency of 'numpy', was not found. If you installed this distribution with pip then you may ignore this warning.
76721 WARNING: Hidden import "pkg_resources.py2_warn" not found!
76721 WARNING: Hidden import "pkg_resources.markers" not found!

I checked the packages in the env and I have installed numpy, importlib_resources. For pkg_resources, pip throws no matching distribution error.

I also found that the suffix of the output file is '.exe.notanexecutable', not '.exe'.

125205 INFO: Copying bootloader EXE to C:\Users\XinDong\Documents\tool\dist\tool.exe.notanexecutable
...
125615 INFO: Updating manifest in C:\Users\XinDong\Documents\AP_TST\tool\dist\tool.exe.notanexecutable

Uninstall your pyinstaller, then install it from the following link https://github.com/pyinstaller/pyinstaller/tarball/develop most likely, the problem is solved

Yout could use auto-py-to-exe. Thats works for me fine(uses pyinstaller as well). It may add a few parameters that could fix your problem(not shure).

It would be interesting to know what modules your code uses and if it creates a database or so.

Maybe the other pc is just lackin hardware.

PS: Sorry, for using answer. I do not have the reputation for comments yet.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM