Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pyside2 installation problem on ubuntu18.04, python 3.8.3 on anaconda

Tags:

python

pyside2

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 example, an error occurred:

Traceback (most recent call last):
  File "test.py", line 2, in <module>
    from PySide2.QtWidgets import QApplication, QLabel
ImportError: /usr/lib/x86_64-linux-gnu/libgssapi_krb5.so.2: symbol krb5_ser_context_init version krb5_3_MIT not defined in file libkrb5.so.3 with link time reference

I when to /usr/lib/x86_64-linux-gnu and found both libgssapi_krb5.so.2 and libkrb5.so.3, and I have no idea how to fix this bug. Can anybody help me?

My environment:

python: 3.8.3

OS: ubuntu 18.04

CPU: AMD ryzen 3600

like image 878
Chuang Men Avatar asked Mar 03 '23 05:03

Chuang Men


1 Answers

You are getting the error because you have a wrong version of qt on your machine. I mean it seems anaconda installs the wrong version of QT by default. First, you need to install essential packages (enter link description here) and then do the following steps:

  1. pip uninstall pyside2, qt, pyqt5 if you have installed them with pip
  2. conda remove pyside2, qt, pyqt5 if you have installed them with conda
  3. conda install -c conda-forge pyside2
like image 78
A.M Avatar answered May 17 '23 10:05

A.M