简体   繁体   English

导入语句中缺少PyQt4

[英]PyQt4 Missing in import statement

I tried to download PyQt4 however it no lomger appears to be available, so I downloaded the nearest thing to it that I could find PyQt-win-gpl-4.8.4. 我尝试下载PyQt4,但是似乎没有可用的lomger,因此我下载了与之最接近的东西,可以找到PyQt-win-gpl-4.8.4。 The problem is when I try to follow the examples in "Rapid GUI programming with Python and QT" i cannot use some of the imports eg from PyQt4.QtCore import * gives me the following Error (copied from IDLE): 问题是当我尝试遵循“使用Python和QT快速GUI编程”中的示例时,我无法使用某些导入,例如从PyQt4.QtCore导入*给我以下错误(从IDLE复制):

Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
`import sys
`import time
`from PyQt4.QtCore import *

**Traceback (most recent call last):
  File "<pyshell#2>", line 1, in <module>
    from PyQt4.QtCore import *
ImportError: DLL load failed: The specified procedure could not be found.
>>>** 

You downloaded a source package, so you'd have to compile everything. 您下载了源程序包,因此必须编译所有内容。 Try the binary package at the bottom of Riverbank's page . 尝试在Riverbank页面底部的二进制包。 As you have python 2.7 on a 32bit system, you want to download PyQt-Py2.7-x86-gpl-4.8.4-1.exe . 由于您在32位系统上安装了python 2.7,因此需要下载PyQt-Py2.7-x86-gpl-4.8.4-1.exe

As far as I know you could just intall pyqt4 with either: 据我所知,您可以使用以下任一方法安装pyqt4:

pip install pyqt4

or 要么

easy_insatll pyqt4

or 要么

http://www.riverbankcomputing.co.uk/software/pyqt/download http://www.riverbankcomputing.co.uk/software/pyqt/download

-> under Binary Packages choose the one that correspondends to your python version and system ->在Binary Packages下选择与您的python版本和系统对应的一个

for you this schould be the right one: pyqt4 py2.7 32bit 对于您来说,这应该是正确的选择: pyqt4 py2.7 32bit

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM