PySide import error Mac OS X El Capitan, Library not loaded: @rpath/libpyside.cpython-34m.1.2.dylib

不问归期 提交于 2019-12-03 20:16:29
Frank Rueter

I got it to work. First, following this thread here

This gave the option of using PySide 1.2.2 or building 1.2.4 from scratch. I settled for 1.2.2:

pip install -U PySide==1.2.2

After that, when trying to import PySide libraries, I got errors complaining about

unsafe use of relative rpath

To fix those I followed this advise

In a nutshell: I checked the libraries for relative links like this:

otool -L /Library/Python/2.7/site-packages/PySide/QtCore.so

Then I used install_name_tool -change ... as outlined in above link to re-link the two relative libraries in there to "/usr/local/...". E.g.:

sudo install_name_tool -change libshiboken-python2.7.1.2.dylib /usr/local/lib/libshiboken-python2.7.1.2.dylib QtCore.so
sudo install_name_tool -change libpyside-python2.7.1.2.dylib /usr/local/lib/libpyside-python2.7.1.2.dylib QtCore.so

Rinse and repeat for all the .so files. This got PySide 1.2.2 working on El Capitan for me.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!