Undefined symbol error importing PySide

1.3k views Asked by At

I'm trying to create a Python 2.7 installation on CentOS 6, that includes PySide. I compiled a wheel package, per these instructions, and installed it without error.

However, I get this error when I try to run the postinstall script:

/opt/python/lib/python2.7/site-packages/PySide/libpyside-python2.7.so.1.1: undefined symbol: _ZN9QMetaType15registerTypedefEPKci

I get the same error with "from PySide import QtCore" in IPython.

These are the commands I used to build and install:

/opt/python/bin/python setup.py bdist_wheel --qmake=/opt/python/lib/qt4/bin/qmake
cp dist/PySide-1.2.2-cp27-none-linux-x86_64.whl /opt/python/src
cd /opt/python
bin/pip ../src/PySide-1.2.2-cp27-none-linux-x86_64.whl
bin/python bin/pyside_postinstall.py -install

Update: I was able to resolve this by setting LD_LIBRARY_PATH to include /opt/python/lib/qt4. I'd assumed that this would get built into PySide by setting the qmake path at compile time.

Is there a way to do this, without setting LD_LIBRARY_PATH?

1

There are 1 answers

0
orodbhen On

Changing the Qt configure command to:

./configure -debug -rpath -prefix '/opt/python/lib/qt4' | tee config.log

Using -rpath makes it so everything built with the custom qmake will have the Qt library path hardcoded into it.