pyside / PySide

ATTENTION: This project is deprecated, please refer to PySide2
https://wiki.qt.io/PySide2
GNU Lesser General Public License v2.1
291 stars 66 forks source link

Fresh install of PySide on Brewed Python 2 has @rpath issue #154

Open autumnjolitz opened 7 years ago

autumnjolitz commented 7 years ago

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 6 years ago

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 5 years ago

I hit exactly the same error.