(2020.1.2已解决)pyinstaller生成文件application failed because not find the Qt platform plugin "windows"...

关于pyinstaller知识汇总参见《Python中pyinstaller如何打包生成exe文件及可能问题汇总》

  • 问题描述

    在这里插入图片描述

    打包的文件中使用了matplotlib用于展示,matplotlib模块虽然复制到了打包文件所在路径,但是matplotlib本身还引用了Qt里的展示模块。
    因此还需要把相关模块一并复制到生成文件所在路径,即Qtplatform文件夹

  • 解决方案1

    找到Qtplatform文件夹,我的路径是:

    C:\Users\Administrator\Anaconda3\pkgs\qt-5.9.6-vc14h1e9a669_2\Library\plugins\platforms

    将此platforms文件夹复制到生成文件文件夹内。
    划重点,复制到生成的.exe文件所在目录,而非打包时候的工作目录。
    详情参见Stackoverflow2

  • References


  1. pyqt5打包成exe 及 …because it could not find or load the Qt platform plugin “windows”…问题解决 ↩︎

  2. PyInstaller; “could not find or load the Qt platform plugin ”windows" ↩︎

发布了753 篇原创文章 · 获赞 1021 · 访问量 54万+

猜你喜欢

转载自blog.csdn.net/The_Time_Runner/article/details/103808760