After installing anaconda3, I began to install pyside2.
I directly typed pip install pyside2
, and successfully installed pyside2 5.15. But when I ran the toy
I had a similar issue, though I was not using anaconda. The error appears to be a krb5 version mismatch between PySide2 and Ubuntu packages. I was able to resolve the issue by compiling krb5 from source and adding the lib directory to LD_LIBRARY_PATH.
tar xf krb5-1.18.2.tar.gz
cd krb5-1.18.2/src
./configure --prefix=/opt/krb5/
make && make install
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/krb5/lib
python -c "import PySide2.QtCore"
The python import no longer raised an error. I found this worked with several different krb5 versions from the offical website; the error seems to be in the Ubuntu modifcations to the package.
You may have success with uninstalling and reinstalling the Python Qt bindings, as suggested by the other answers, but this did not work for me.