pyinstaller打包程序后提示No module named ‘xxxx‘

解决方法1

1、检查 先在venv环境中安装xxx 报错的这个包

以我的举例 查看settings>project interpreter  (存在对应的包)

 

解决方法2

2、在xxx.spec  文件中 添加 导入模块 pytest

 

再次重新打包  pyinstaller xxx.spec

运行exe  运行成功.....

 

posted @ 2023-06-20 09:23  攻城狮-tester  阅读(55)  评论(0编辑  收藏  举报