Important: Please read the Qt Code of Conduct -

PySide6 on RHEL 7 problem

  • I compiled Qt 6.1 from source on Redhat Enterprise Linux 7 successfully, installed to custom location and set QTDIR to that location.

    I then followed the directions for installing the PySide6 package from by first creating a virtual environment, activating it, and then pip installing PySide6. (using Python 3.9.2)

    The problems start when trying to simply test the installation as shown on the same page...

    import PySide6.QtCore
    # Prints PySide6 version
    # Prints the Qt version used to compile PySide6
    Traceback  (most recent call last):
    File "<stdin>",  line 1, in <module>
    AttributeError: Module 'PySide6' has no attribute 'QtCore'

    I have successfully gotten PySide6 to work on Ubuntu Linux running on WSL2 in the same manner (compiling Qt 6.1 from source and pip installing PySide6).

    Any idea what's going on here?


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    To the best of my knowledge, there's no need to build your own Qt when installing PySide6 from pip.

    What might happen is that it fails to load the Qt libraries that comes with it.

  • Thanks for suggesting this...I tested it out on WSL2 at home today and sure enough, it appears to not need a separate install of Qt on the system ... this was unclear to me in the documentation. I've used Qt/C++ for 20+ years, but am new to the python bindings.

    However, on this system where I hadn't previously added all the prerequisite libraries in order to compile Qt Source (xcb, xkb, etc..) , I had to add them to get the PySide6 pip install to run. This was definately not mentioned in the PySide documentation.

    I will attempt to figure out the RHEL issue again on Monday...that system does have all the libraries for compiling source already, so hopefully it's just getting confused by either the QTDIR, PATH, or LD_LIBRARY_PATH that's set. Will update here then.

  • Lifetime Qt Champion

    Start your application with the QT_DEBUG_PLUGINS environment variable set to 1.

    If will give you information about what is happening with the plugins. The xcb in your case.

  • So digging in to sort out why PySide6 pip install doesn't work on RHEL 7...

    Looks like the basic problem is that libQt6Core among other libs have a GLIBC_2.25 and GLIBC_2.28 requirement that does not exist on this version of the OS.

    Looks like my best recourse is to step back and natively compile the PySide6 source. So much for the dream of a simple pip install and update process.

  • Lifetime Qt Champion

    One thing you can try is conda.

Log in to reply