pydub“ ModulenotfoundError”使用Pyinstaller时

发布于 2025-02-01 23:04:05 字数 497 浏览 5 评论 0原文

我正在尝试使用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 :
error

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

清晰传感 2025-02-08 23:04:05

尝试使用PIP安装它。

pip3 install pydub

也许您有多个Python版本

Try installing it with pip .

pip3 install pydub

Maybe you have multiple python versions

若能看破又如何 2025-02-08 23:04:05

由于我已经安装了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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文