V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
qsnow6
V2EX  ›  Python

使用 pyinstaller 打包 PyQt 错误的解决方案

  •  1
     
  •   qsnow6 · 2018-01-09 12:57:12 +08:00 · 3356 次点击
    这是一个创建于 2289 天前的主题,其中的信息可能已经有所发展或是发生改变。

    用 pyqt 写了个小工具,要打包给同事用。但是传过去打开后,发现报错了,提示

    This application failed to start because it could not find or load the Qt platform plugin windows installing the application may fix this problem
    

    This application failed to start because it could not find or load the Qt platform plugin windows installing the application may fix this problem

    但是本机、虚拟机都没问题,32、64bit 也都测了。于是就把问题定位到了系统环境本身的问题,百度了一翻,靠谱的答案没几个。

    后面在c++ - Application failed to start because it could not find or load the QT platform plugin "windows" - Stack Overflow让到了解决办法,只需要把platforms 目录拷贝一份,放到打包好的 exe 程序目录下就 Ok 了。

    顺便还解决了其他的乱七八糟的缺失 dll 的错误

    ...
    3743 WARNING: lib not found: api-ms-win-crt-process-l1-1-0.dll dependency of c:\python36-32\python36.dll
    3862 WARNING: lib not found: api-ms-win-crt-conio-l1-1-0.dll dependency of c:\python36-32\python36.dll
    ...
    

    类似 lib not found: api-ms-win-xxxxxxxxxxxx.dll这样的提示,直接复制一份到程序所在目录就可以了。

    dll 打包

    为了方便后面躺坑的,把我的 dll 文件打包传上来,下载地址: https://pan.baidu.com/s/1dTBwui

    资料参考

    https://stackoverflow.com/questions/21268558/application-failed-to-start-because-it-could-not-find-or-load-the-qt-platform-pl

    http://blog.csdn.net/liyuefeilong/article/details/44109403

    http://blog.csdn.net/a359680405/article/details/45077187

    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1286 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 23:25 · PVG 07:25 · LAX 16:25 · JFK 19:25
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.