PySide / Qt Import Error

北城以北 提交于 2019-11-30 04:45:59

Well, the installer is somewhat broken, because the output from oTool should report a full path to the library (the path should be changed by the Pyside installer using install_name_tool).

Instead of going mad understanding what part of the installer is broken, I suggest you define:

DYLD_LIBRARY_PATH=/your/path/to/pyside/libraries
export DYLD_LIBRARY_PATH

This will force the executable loader to scan for libraries into the path you supply too, even it's not configured by the linker.

if you watch this , you're question will be fixed: https://github.com/pyside/packaging/blob/master/setuptools/templates/pyside_postinstall.py

pyside_postinstall.py -install

I had a similar issue, and I resolved it by manually using otool -L (as seen in the question) and install_name_tool to update the paths.

install_name_tool -change @rpath/libshiboken.cpython-34m.1.2.dylib /usr/local/lib/python3.4/site-packages/PySide/libshiboken.cpython-34m.1.2.dylib /usr/local/lib/python3.4/site-packages/PySide/QtCore.so

install_name_tool -change @rpath/libpyside.cpython-34m.1.2.dylib /usr/local/lib/python3.4/site-packages/PySide/libpyside.cpython-34m.1.2.dylib /usr/local/lib/python3.4/site-packages/PySide/QtCore.so

I had to do this for several files in the PySide directory before the script would run.

This blog post is a nice reference: http://thecourtsofchaos.com/2013/09/16/how-to-copy-and-relink-binaries-on-osx/

i found a solution here

export DYLD_LIBRARY_PATH=/usr/local/lib/python[version]/site-packages/PySide

for python 3.5 this would be

export DYLD_LIBRARY_PATH=/usr/local/lib/python3.5/site-packages/PySide

I had a similar problem, on Mavericks using a Brew-installed Qt and virtual environment.

I had to brew reinstall Qt

Then run the pyside_postinstall.py -install

See here: https://github.com/Homebrew/homebrew/issues/27898

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