pydub“ ModulenotfoundError”使用Pyinstaller时
我正在尝试使用pyinstaller将.py文件转换为.exe。当我尝试运行可执行文件时,显示以下错误:
我当前的pyinstaller命令是以下内容:
pyinstaller --noconfirm --onefile --console --hidden-import "pydub" --add-data "C:/Users/me/AppData/Local/Programs/Python/Python37/Lib/site-packages/customtkinter;customtkinter/" "C:/Users/me/PycharmProjects/TestProj/main.py"
I am trying to convert a .py file to .exe using pyinstaller. When I try to run the executable the following error is shown :
My current pyinstaller command is the following:
pyinstaller --noconfirm --onefile --console --hidden-import "pydub" --add-data "C:/Users/me/AppData/Local/Programs/Python/Python37/Lib/site-packages/customtkinter;customtkinter/" "C:/Users/me/PycharmProjects/TestProj/main.py"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试使用PIP安装它。
也许您有多个Python版本
Try installing it with pip .
Maybe you have multiple python versions
由于我已经安装了PYDUB并将PYDUB添加到隐藏的导入量中,因此我尝试在虚拟环境中删除我不需要的每个文件。删除所有相关文件并在.spec文件旁边删除旧的构建/DIST文件夹似乎已解决了问题。
As I already pip installed pydub and added pydub to the hidden imports I tried to delete every file in my Virtual Environment that I didn't need. Deleting all Pycharm related files and deleting the old build/dist folder alongside the .spec file seems to have fixed the problem.