。pyinstaller内置的. exe仅在从cmd运行时打开

问题描述 投票:0回答:1

我创建了一个pyinstaller .exe,可以正确构建它,而pyinstaller没有任何错误。当我从cmd运行它时,它可以完美运行,但是当我双击.exe文件时,它不起作用。我读到它与PyQt5有一定关系,但是我没有使其工作。这是创建语句:

    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

提前感谢!

python windows pyqt pyinstaller
1个回答
0
投票

不知道在Windows中是否相同。但是在Linux中使用带有-F选项的pyinstaller(pyinstaller -F file.py)和PyQt5项目,我必须将resource.py文件和封闭的png手动添加到二进制文件.qss和.ui文件中。也不读。您还检查了使用的版本吗? Python 2 vs 2,3 vs 3 etc ... v

© www.soinside.com 2019 - 2024. All rights reserved.