Fresh install of PySide on Brewed Python 2 has @rpath issue
autumnjolitz opened this issue · 2 comments
autumnjolitz commented
There is no virtualenv shenigans here, only PySide installed on Sierra using the following:
brew install cartr/qt4/qt
brew install cmake
/usr/local/bin/python -m pip install pyside
Installed version:
tv:PySide ben$ /usr/local/bin/python2.7 -m pip freeze | grep -i pyside
PySide==1.2.4
Given that this prefix is in /usr/local, I would assume that PySide should safely work, however the following failed:
>>> from PySide import *
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: dlopen(/usr/local/lib/python2.7/site-packages/PySide/QtCore.so, 2): Library not loaded: @rpath/libpyside-python2.7.1.2.dylib
Referenced from: /usr/local/lib/python2.7/site-packages/PySide/QtCore.so
Reason: image not found
>>>
Correcting the issue was as simple as setting the rpath to look into the packages installation directory:
tv:~ ben$ cd /usr/local/lib/python2.7/site-packages/PySide
tv:PySide ben$ for filename in $(ls *.so); do install_name_tool -add_rpath `pwd` $filename; done
I suspect that something is not functioning correctly in the fix up script.
mplec commented
I just ran into the exact same error. In my case there were virtualenv shenanigans, but that doesn't seem to help or hurt. I successfully worked around with the same install_name_tool -add_rpath fix.
huidong-chen commented
I hit exactly the same error.