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

正常编译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文件,可以执行过,只是缺少对应的环境变量。


在环境变量中增加:

QT_QPA_PLATFORM_PLUGIN_PATH

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

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


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

 

参考:

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




  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值