简体   繁体   中英

.exe built with pyinstaller is only opened while running from cmd

I created a pyinstaller.exe that is built correctly without any mistakes with pyinstaller. When I run it from the cmd, it runs perfectly, but when I double click the.exe file, it does not work. I read that has to do something with PyQt5, but I didn't make it work. This is the creation statement:

    pyinstaller --paths 
    C:\Users\430350\AppData\Local\Programs\Python\Python36\Lib\site- 
    packages\PyQt5\Qt\bin "path" --hidden-import numpy.core._dtype_ctypes --hidden- 
    import fix_qt_import_error --icon=icon.ico --noconfirm

Thanks in advance!

Don't know if it's the same in Windows. But using pyinstaller in Linux with the -F option (pyinstaller -F file.py) with a PyQt5 project I have to add to the binary file folder.qss and.ui files manually my resource.py file and enclosed png. are not read too. Also did you check the versione you are using? Python 2 vs 2, 3 vs 3 etc... v

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