尝试使用PySide开发,但遇到麻烦 得到安装。我尝试安装binaries 1.0.4-r1 and 1.0.5但是 这两个在导入PySide上产生了以下消息
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Python/2.6/site-packages/PySide/__init__.py", line 2,
in <module>
import private
File "/Library/Python/2.6/site-packages/PySide/private.py", line 2,
in <module>
from QtCore import __moduleShutdown
ImportError: dlopen(/Library/Python/2.6/site-packages/PySide/
QtCore.so, 2): Library not loaded: QtCore.framework/Versions/4/QtCore
Referenced from: /Library/Python/2.6/site-packages/PySide/QtCore.so
Reason: image not found
然后我尝试从gitorious build scripts进行安装。运用 sudo ./dedenciesRIS.osx.sh。完成后我现在得到了 导入PySide时出现以下错误。
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Python/2.6/site-packages/PySide/__init__.py", line 2,
in <module>
File "/Library/Python/2.6/site-packages/PySide/private.py", line 2,
in <module>
ImportError: No module named QtCore
任何建议表示赞赏。我正在使用QtCreator 2.2.1和Qt SDK 1.1.2 / Qt Library 4.7.3。谢谢!
答案 0 :(得分:2)
首先尝试安装最新版本的MacPorts和python 2.7,并将python2.7设置为默认的python版本:
sudo port install python27
port select --list python
sudo port select --set python python27
然后再次重新安装PySide:
sudo port install py27-pyside
答案 1 :(得分:2)
我刚刚遇到了完全相同的问题:
Library not loaded: QtCore.framework/Versions/4/QtCore
您需要找到已安装的QT库并使其对动态链接器可见。
我的Qt*.framework
文件夹位于/usr/local/lib
(Qt随Homebrew软件包管理器一起安装)。所以,我添加了
export DYLD_FRAMEWORK_PATH=/usr/local/lib:$DYLD_FRAMEWORK_PATH
到~/.bash_profile
并重新启动控制台。
那就是它。
答案 2 :(得分:0)
I just solved the same problem by using homebrew to install pyside.
$ sudo -H pip uninstall pyside
$ brew install pyside