Reputation: 7822
I'm trying to use PySide so I did a brew install pyside pyside-tools
. However, I get the following error:
>>> from PySide.QtGui import QApplication
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: dlopen(/Library/Python/2.7/site-packages/PySide/QtGui.so, 2): Library not loaded: QtGui.framework/Versions/4/QtGui
Referenced from: /Library/Python/2.7/site-packages/PySide/QtGui.so
Reason: image not found
This SO question says to install python 27 and then reinstall pyside but I'm using the native python on mac osx 10.8 and it is already 2.7.2.
The Homebrew recipe for PySide seems to indicate that this should have been fixed but I'm still getting the errors. I made sure libpng is installed as well.
Looking at the path, I know that the QtGui.so file is there. Since I'm new to Python, PySide, and Qt, it is hard for me to Google and further troubleshoot.
If anyone knows why and can provide directions, I will be very grateful. It can involve uninstalling a bunch of stuff and reinstalling. Please give detailed instructions. I did uninstall and try to reinstall and got the same result.
Thank you.
Upvotes: 5
Views: 3541
Reputation: 4268
Got the same error when running ipython qtconsole
which will import PySide to provide a Qt console.
Finally I thought there might be something wrong after PySide's installation. So I run pyside_postinstall.py -install
manually which should be automatically run after PySide is installed, and this fixed my problem. Hopes working for your too!
Upvotes: 1
Reputation: 51
I was getting the same error, and I'm using Python installed via Homebrew. I found two PySide libraries in /Library/Python/2.7/site-packages/ . Moving them out of the way, and re-building/installing PySide through Homebrew worked.
Upvotes: 5
Reputation: 343
I tried the import you gave - I am using same system environment. It worked fine. try: brew update and re-install.
Upvotes: 1