pyqt在mac osx雪豹中安装问题
我正在学习制作桌面应用程序的教程。使用python和qt4,我下载并安装了qt Creator ide,创建了.ui文件,然后我必须使用pyuic4对其进行转换,我已经尝试了很多东西但仍然无法做到。
我以为 pyuic4 会与 Qt Creator IDE 一起安装,但似乎并非如此,所以我通过 macports 安装了 pyqt:
sudo port install py26-pyqt4
我不知道,但那是 qt 附带的,所以构建它大约花了 3 个小时。
安装后我尝试再次转换.ui:
$ pyuic4-2.6 principal.ui -o prin.py
Traceback (most recent call last):
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/PyQt4/uic/pyuic.py", line 4, in <module>
from PyQt4 import QtCore
ImportError: No module named PyQt4
没有名为 PyQt4 的模块?这不是我刚刚安装的吗?
谢谢,如果我的英语不是 100% 好,请原谅。
I'm following a tutorial of making desktop apps. with python and qt4, I downloaded and installed qt creator ide, created the .ui file and then I had to convert it using pyuic4, I've been trying a lot of things and still can't do it.
I thought that pyuic4 would be installed with Qt creator IDE, but it seems that's not the case, so I installed pyqt through macports:
sudo port install py26-pyqt4
I didn't know but that came with qt, so it was about 3 hours building it.
after installing it I tried to convert the .ui again:
$ pyuic4-2.6 principal.ui -o prin.py
Traceback (most recent call last):
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/PyQt4/uic/pyuic.py", line 4, in <module>
from PyQt4 import QtCore
ImportError: No module named PyQt4
No module named PyQt4? wasn't that what I just installed?
Thanks, and excuse me if my english isn't 100% good.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我已经解决了这个问题,你必须使用macports的python而不是OS X自带的默认Python,才能通过macports安装python_select:
I've solved it, you have to use the python of macports instead of the default that comes with OS X, to do that install python_select through macports:
我做了 一些关于在 Mac Snow 上构建和安装 PyQt4 的说明豹子。
顺序很重要,而且 64 位库有一些怪癖。默认的 Mac Qt 库是 Carbon(32 位),而 Mac 系统 Python 是 64 位,需要 Cocoa 库。
I made some notes on building and install PyQt4 on Mac Snow Leopard.
The order is important, and there are some quirks with 64-bit libraries. The default Mac Qt libs are Carbon (32 bit), whereas Mac system Python is 64 bit and needs the Cocoa libs.
我花了一段时间在 Homebrew 中查找包名称。似乎是:
I spent a while finding the package name in Homebrew. It seems to be: