2011-08-07 257 views
4

試圖讓我的腳溼透PySide的開發,但有困難 進行設置。我試圖安裝binaries 1.0.4-r1 and 1.0.5但 這兩個產生以下消息對進口PySide在OSX上安裝PySide 10.6.8

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 ./dependencies.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庫4.7.3。謝謝!

+0

我在安裝PySide和QT的最新版本的OSX 10.6.8上也有類似的情況。 – Aaron

+0

用macports安裝時同樣的事情... – Jelle

回答

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 
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並重新啓動控制檯。

就是這樣。

0

我剛剛解決了同樣的問題,使用homebrew來安裝pyside。

$ sudo -H pip uninstall pyside 
$ brew install pyside