问题描述
我一直试图在Vista上安装 PyQt 4.7 ,但是当我尝试执行from PyQt4 import QtCore, QtGui
时却遇到了ImportError.
I've been trying to install PyQt 4.7 on Vista, but I am getting an ImportError when I try to do: from PyQt4 import QtCore, QtGui
.
我已经检查了系统路径,并且在其中 C:\ Python31 \ Lib \ site-packages \ PyQt4 \ bin .
I've checked my System Path, and C:\Python31\Lib\site-packages\PyQt4\bin is on there.
我无法运行任何示例,但Designer,Assistant和Linguist可以正常运行.
I can't run any of the examples, but the Designer, Assistant and Linguist run fine.
我正在使用ActivePython 3.1,如果有什么不同的话.而且我还没有安装任何以前的PyQt版本.
我已将QtCore4和GtGui4 dll复制到 C:\ Python31 \ Lib \ site-packages \ PyQt4 .这样可以修复一些示例,但是我仍然不能使用示例浏览器.
I've copied the QtCore4 and GtGui4 dlls to C:\Python31\Lib\site-packages\PyQt4. That fixes some of the examples, but I still can't use the example browser.
推荐答案
您确定您的PyQt版本有一个\bin
目录吗?我正在运行PyQt 4.4,所有二进制文件都位于:
Are you sure there is a \bin
directory for your version of PyQt?I am running PyQt 4.4, and all my binaries are right in:
C:\ Python31 \ Lib \ site-packages \ PyQt4
我也指出了我的道路.听起来PyQt4安装不正确...您运行了此程序吗?
Which is what I have my path pointing too.It sounds like PyQt4 was installed improperly... did you run this?
python setup.py install
那里不应该在那里有一个垃圾箱...
There shouldn't be a bin there...
这篇关于PyQt 4.7-在Windows上安装后出现ImportError的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!