Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ionic-framework/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 3.x pyinstaller——onefile不';不要复制必要的文件_Python 3.x_Pyqt_Pyqt5_Exe_Pyinstaller - Fatal编程技术网

Python 3.x pyinstaller——onefile不';不要复制必要的文件

Python 3.x pyinstaller——onefile不';不要复制必要的文件,python-3.x,pyqt,pyqt5,exe,pyinstaller,Python 3.x,Pyqt,Pyqt5,Exe,Pyinstaller,最近,我在python3中用PyQT5制作了一个GUI应用程序,这个应用程序包括图像和音乐。 我的源代码运行正常,但使用此命令时: pyinstaller --onefile GUI.py 为了生成.exe文件,我的应用程序无法正常运行,当我复制.exe旁边的图像和音乐时,它工作正常。 我想知道如何使用pyinstaller生成.exe,其中包含我的数据文件,并且我想不显示我的数据文件。按照说明在文件GUI.spec中添加文件目录 然后删除pyinstaller创建的所有文件夹,除了GUI.s

最近,我在python3中用PyQT5制作了一个GUI应用程序,这个应用程序包括图像和音乐。 我的源代码运行正常,但使用此命令时:

pyinstaller --onefile GUI.py
为了生成.exe文件,我的应用程序无法正常运行,当我复制.exe旁边的图像和音乐时,它工作正常。
我想知道如何使用pyinstaller生成.exe,其中包含我的数据文件,并且我想不显示我的数据文件。

按照说明在文件
GUI.spec
中添加文件目录

然后删除pyinstaller创建的所有文件夹,除了
GUI.spec

输入终端:
pyinstaller GUI.spec
(注意:这次是
.spec
,不是
.py