PyQt4 导入语句中缺失

发布于 2024-11-26 02:12:17 字数 615 浏览 0 评论 0原文

我尝试下载 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

时光倒影 2024-12-03 02:12:17

您下载了源代码包,因此您必须编译所有内容。尝试 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.

红尘作伴 2024-12-03 02:12:17

据我所知,您可以使用以下任一方式安装 pyqt4:

pip install pyqt4

easy_insatll 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:

pip install pyqt4

or

easy_insatll pyqt4

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文