Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-843

PySide2 does not link to bundle Qt libraries by default

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 5.11.2, 5.12.0
    • PySide
    • None
    • $ uname -a
      Linux wshanksred.localdomain 4.18.11-200.fc28.x86_64 #1 SMP Sun Sep 30 15:31:40 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

      Using the KDE Plasma desktop
    • Linux/X11

    Description

      On Fedora 28, when I install PySide2 into a new virtual environment (using `python3 -m venv` with the system Python 3.6.6), I see the following in the Python REPL:

      // code placeholder
      Python 3.6.6 (default, Jul 19 2018, 14:25:17) 
      [GCC 8.1.1 20180712 (Red Hat 8.1.1-5)] on linux
      Type "help", "copyright", "credits" or "license" for more information.
      >>> from PySide2 import QtCore
      Traceback (most recent call last):
        File "<stdin>", line 1, in <module>
      ImportError: /usr/lib64/libQt5Core.so.5: version `Qt_5.12' not found (required by /home/user/tmp/pyside/lib64/python3.6/site-packages/PySide2/QtCore.abi3.so)
      >>> 
      

      If I run

      export LD_LIBRARY_PATH=$PWD/lib/python3.6/site-packages/PySide2/Qt/lib:$LD_LIBRARY_PATH 

      from the root of the virtual environment and then start the REPL again, I see:

      Python 3.6.6 (default, Jul 19 2018, 14:25:17) 
      [GCC 8.1.1 20180712 (Red Hat 8.1.1-5)] on linux
      Type "help", "copyright", "credits" or "license" for more information.
      >>> from PySide2 import QtCore
      >>> 
      

      I see this for both the version on PyPI and the latest version on download.qt.io (PySide2==5.12.0a1.dev1541316155).

      I am not that familiar with packaging shared libraries into a Python wheel like this. What mechanism is supposed to be used so that the Python bindings link to the appropriate Qt libraries? I have also been working with PySide2 on Arch Linux without a problem, but it is possible that PySide2 is still linking to the system Qt libraries there and they just happen to work, unlike the Fedora ones.

      (By the way, it is really cool how the wheel packages the Qt libraries - I hope that it will be possible to pip install my projects without any dependencies external to Python and without needing to modify environment variables).

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              crmaurei Cristian Maureira-Fredes
              wsha Will Sha
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes