首页 > Windows开发 > 详细

pyqt5.2 + vs2010-- could not find or load the Qt platform plugin windows

时间:2014-01-21 09:48:16      阅读:1125      评论:0      收藏:0      [点我收藏+]

正常编译pyqt 5.2后,在Wing IDE中执行报错。


This application failed to start because it could not find or load the Qt platform plugin windows

Reinstalling the application may fix this problem.

代码如下 p1.py :

import sys  
from PyQt5.QtCore import pyqtSignal, QObject, QSize, Qt, QUrl
from PyQt5.QtGui import QImage, QPainter
from PyQt5.QtWidgets import *
from PyQt5.QtWebKitWidgets import QWebPage
from PyQt5   import QtGui
app = QApplication(sys.argv)  
label = QLabel("Hello Qt!")  
label.show()   
sys.exit(app.exec_())

网上很多帖子都在谈论这个问题,绝大多数都在说qt打包程序不能启动,要粘~\plugins\platformsqwindows.dll。对于本机plugins路径在path中已经设置了,在cmd中执行下py文件,可以执行过,只是缺少对应的环境变量。

bubuko.com,布布扣

在环境变量中增加:

QT_QPA_PLATFORM_PLUGIN_PATH

D:\Qt\Qt520vs2010glx86\5.2.0\msvc2010_opengl\plugins

这个plugins和~\Python27\Lib\site-packages\PyQt5\plugins中的貌似一样,我设置的是qt安装目录下的原版。

bubuko.com,布布扣

重新启动Wing IDE,是的,我用的版本4.1.10 一定要重启,摸索半天才发现,血的教训。

 

参考:

http://qt-project.org/forums/viewthread/22908




pyqt5.2 + vs2010-- could not find or load the Qt platform plugin windows

原文:http://blog.csdn.net/sgcc_zhs/article/details/18237957

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!