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

PySide6 6.2.2 not importable on Python 3.6 and 3.7 on macOS

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • None
    • 6.2.2, 6.2.3, 6.3.0
    • PySide
    • None
    • macOS 11.6.2 (Big Sur), Intel MacBook Pro
      Python 3.6.15 (from MacPorts)

      Debian Buster, Debian Bullseye, Ubuntu 20.04
    • Linux/X11, macOS
    • bcd1ac22f8 (pyside/pyside-setup/dev) 725be71849 (pyside/pyside-setup/6.3) 725be71849 (pyside/pyside-setup/wip/6.3_pypy) 725be71849 (pyside/tqtc-pyside-setup/6.3) 4a799fee40 (pyside/tqtc-pyside-setup/6.2), 7f567ae2a (tqtc/lts-5.15), 755bf6cab (dev)

    Description

      The PySide6 macOS universal2 wheels uploaded for recent releases 6.2.2 and 6.2.2.1 appear to have an ABI compatibility issue on Python 3.6 and 3.7, and following a successful `pip install`, importing `PySide6.QtCore` fails with this combination of platform and Python version, with error "Symbol not found: _PyIndex_Check"

      Detailed steps to reproduce:

      • Create a new Python 3.6 or Python 3.7 virtual environment, and activate that environment.
      • If necessary, upgrade `pip` to the most recent version (21.3.1) in that environment
      • Install PySide6 with 
        python -m pip install PySide6
      • Execute
        python -c "import PySide6.QtCore"

      On my machine, the install succeeds, but the final step fails with 

      Symbol not found: _PyIndex_Check

      I was expecting the import to succeed with no error. I see the same results with Python 3.6 and 3.7, but not with Python 3.8 or later. I also don't see any issue with PySide6 6.2.1 or earlier.

      Here's a full transcript of a shell session on my machine. 

      mdickinson@mirzakhani ~ % python3.6 -VV
      Python 3.6.15 (default, Nov  9 2021, 16:18:30) 
      [GCC Apple LLVM 13.0.0 (clang-1300.0.29.3)]
      mdickinson@mirzakhani ~ % python3.6 -m venv --clear ~/.venvs/testing && source ~/.venvs/testing/bin/activate
      (testing) mdickinson@mirzakhani ~ % python -m pip install --upgrade pip
      Collecting pip
        Using cached https://files.pythonhosted.org/packages/a4/6d/6463d49a933f547439d6b5b98b46af8742cc03ae83543e4d7688c2420f8b/pip-21.3.1-py3-none-any.whl
      Installing collected packages: pip
        Found existing installation: pip 18.1
          Uninstalling pip-18.1:
            Successfully uninstalled pip-18.1
      Successfully installed pip-21.3.1
      (testing) mdickinson@mirzakhani ~ % python -m pip install PySide6
      Collecting PySide6
        Using cached PySide6-6.2.2.1-6.2.2-cp36.cp37.cp38.cp39.cp310-abi3-macosx_10_14_universal2.whl (320.4 MB)
      Collecting shiboken6==6.2.2.1
        Using cached shiboken6-6.2.2.1-6.2.2-cp36.cp37.cp38.cp39.cp310-abi3-macosx_10_14_universal2.whl (1.1 MB)
      Installing collected packages: shiboken6, PySide6
      Successfully installed PySide6-6.2.2.1 shiboken6-6.2.2.1
      (testing) mdickinson@mirzakhani ~ % python -c "import PySide6.QtCore"
      Traceback (most recent call last):
        File "<string>", line 1, in <module>
      ImportError: dlopen(/Users/mdickinson/.venvs/testing/lib/python3.6/site-packages/PySide6/QtCore.abi3.so, 2): Symbol not found: _PyIndex_Check
        Referenced from: /Users/mdickinson/.venvs/testing/lib/python3.6/site-packages/PySide6/QtCore.abi3.so
        Expected in: flat namespace
       in /Users/mdickinson/.venvs/testing/lib/python3.6/site-packages/PySide6/QtCore.abi3.so
      

      Entering wild guess territory: I suspect that the issue is that the macOS wheels for the recent releases of PySide6 were built on Python 3.8, presumably because this was the only way to create universal2 wheels. But there was a bug with Python's stable ABI related to PyIndex_Check, which was a macro in Python 3.6 and 3.7, and only became a function in Python 3.8. See https://bugs.python.org/issue33738. So these wheels fail on Python 3.6 and 3.7.

      Attachments

        Issue Links

          For Gerrit Dashboard: PYSIDE-1797
          # Subject Branch Project Status CR V

          Activity

            People

              crmaurei Cristian Maureira-Fredes
              mdickinson Mark Dickinson
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: