PyQt4 导入语句中缺失
我尝试下载 PyQt4,但似乎没有可用的 lomger,所以我下载了最接近的东西,我可以找到 PyQt-win-gpl-4.8.4。问题是,当我尝试遵循“使用 Python 和 QT 进行快速 GUI 编程”中的示例时,我无法使用某些导入,例如 from PyQt4.QtCore import * 给出以下错误(从 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.
>>>**
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. 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 e.g. from PyQt4.QtCore import * gives me the following Error (copied from 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.
>>>**
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您下载了源代码包,因此您必须编译所有内容。尝试 Riverbank 页面底部的二进制包。由于您在 32 位系统上安装了 python 2.7,因此您需要下载
PyQt-Py2.7-x86-gpl-4.8.4-1.exe
。You downloaded a source package, so you'd have to compile everything. Try the binary package at the bottom of Riverbank's page. As you have python 2.7 on a 32bit system, you want to download
PyQt-Py2.7-x86-gpl-4.8.4-1.exe
.据我所知,您可以使用以下任一方式安装 pyqt4:
或
或
http://www. Riverbankcomputing.co.uk/software/pyqt/download
->在“二进制包”下,选择与您的 python 版本和系统相对应的包,
这应该是正确的包:pyqt4 py2.7 32位
As far as I know you could just intall pyqt4 with either:
or
or
http://www.riverbankcomputing.co.uk/software/pyqt/download
-> under Binary Packages choose the one that correspondends to your python version and system
for you this schould be the right one: pyqt4 py2.7 32bit