刚配置好了环境,接下去就是打包exe,这是一套流程嘛

拿出我的打包gui工具,搞起

首先在sublime下测试运行,界面ok没问题

Pyqt5 python2 pyinstaller 打包爬坑
    


            
Cannot find existing PyQt5 plugin directories

 

接下来就是打包

Pyqt5 python2 pyinstaller 打包爬坑
    


            
Cannot find existing PyQt5 plugin directories

第一次直接打包失败

出现了

Pyqt5 python2 pyinstaller 打包爬坑
    


            
Cannot find existing PyQt5 plugin directories

按照下面文章里面的方法,把相应的文件拷贝过去就行了

https://www.cnblogs.com/jkn1234/p/9672957.html

 

然后重新打包,这次没问题,生成exe了

运行下看看:

Pyqt5 python2 pyinstaller 打包爬坑
    


            
Cannot find existing PyQt5 plugin directories

缺包sip,又是网上一顿找,说什么导入这个sip就行了

我给他导进去,from Pyqt5 import sip

重新打包,打开还是不行,还是缺这个包

试试python环境下直接导入sip看看

Pyqt5 python2 pyinstaller 打包爬坑
    


            
Cannot find existing PyQt5 plugin directories

说明没有这个包

去pyqt5包里面看到一个sip.pyd

直接拷贝到C:\Python27\Lib\site-packages

再导入就不提示错误了

然后在脚本里面加1句 import sip

再打包,这次不跳缺包了,跳另一个问题

platform plugin "windows"

Pyqt5 python2 pyinstaller 打包爬坑
    


            
Cannot find existing PyQt5 plugin directories

网上又是一顿找,说把这个文件夹拷过去就好了

Pyqt5 python2 pyinstaller 打包爬坑
    


            
Cannot find existing PyQt5 plugin directories

拷过去还是不行,不过信息变了,说是发现了这几个platfrom

Pyqt5 python2 pyinstaller 打包爬坑
    


            
Cannot find existing PyQt5 plugin directories

再查,看到说是还有个libEGL.dll 也要一起

Pyqt5 python2 pyinstaller 打包爬坑
    


            
Cannot find existing PyQt5 plugin directories

拷过去后打开exe,这次总算ok了

Pyqt5 python2 pyinstaller 打包爬坑
    


            
Cannot find existing PyQt5 plugin directories 

 

 至此填坑完毕,完成了python2+pyqt5+pyinstaller的打包,都是泪啊

下一步就是把这些依赖文件也给打包到一起,后面再试试了

相关文章:

  • 2021-09-15
  • 2022-12-23
  • 2021-11-07
  • 2021-04-04
  • 2021-07-23
  • 2021-10-05
  • 2021-07-24
  • 2022-12-23
猜你喜欢
  • 2021-11-27
  • 2021-05-10
  • 2021-11-03
  • 2022-12-23
  • 2021-07-27
  • 2021-08-10
相关资源
相似解决方案