简体   繁体   English

无法使用Pyinstaller将Python脚本转换为可执行文件:找不到dist文件夹和PyQt5

[英]Cannot convert Python script into an executable using Pyinstaller: Empty dist folder & PyQt5 not found

I am using PyInstaller to create a stand-alone executable file from my Python script. 我正在使用PyInstaller从我的Python脚本创建一个独立的可执行文件。 The Python script was created by Python 3.7.1 and I use Anaconda. Python脚本由Python 3.7.1创建,我使用Anaconda。

When I run Pyinstaller, it creates a .spec file and build and dist folders. 当我运行Pyinstaller时,它将创建一个.spec文件以及build和dist文件夹。 However, the dist folder is empty. 但是,dist文件夹为空。

No errors were reported by Pyinstaller apart from "cannot find existing pyqt5 plugin directories". 除了“找不到现有的pyqt5插件目录”之外,Pyinstaller均未报告任何错误。

How can I solve this problem? 我怎么解决这个问题? Or how I can troubleshoot it so I can understand where the problem is? 或者如何解决该问题,以便了解问题出在哪里?

After several hours reading different threads I have finally found an acceptable solution. 经过几个小时的阅读不同的线程,我终于找到了可以接受的解决方案。

I added: 我补充说:

--exclude-module PyQt5

to exclude PyQt5 since my scrip doesn't use it. 排除PyQt5,因为我的脚本没有使用它。 The exe is created. exe已创建。

Hope it can help someone. 希望它可以帮助某人。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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