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

QApplication() failed in PySide6

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Not Evaluated
    • None
    • 6.6.2
    • PySide
    • None
    • Windows 11 Enterprise 23H2
      Python 3.11 and 3.12 (other not checked)
    • Windows

    Description

      I've make basic QApplication

      from PySide6.QtWidgets import QApplication, QLabel
      
      app = QApplication([])
      hello_label = QLabel('Hello, PySide6!')
      hello_label.show()
      print('working!')
      app.exec()
      print('done!')
      

      And run with PySide6 6.6.1 with Python 3.11.7 and 3.12.1

      PS C:\Users\mplichta\Projects\dcspy> pip list

      Package            Version
      ------------------ --------
      annotated-types    0.6.0
      certifi            2024.2.2
      cffi               1.16.0
      charset-normalizer 3.3.2
      gitdb              4.0.11
      GitPython          3.1.42
      idna               3.6
      packaging          23.2
      pillow             10.2.0
      pip                24.0
      psutil             5.9.8
      pycparser          2.21
      pydantic           2.6.2
      pydantic_core      2.16.3
      PySide6            6.6.1
      PySide6-Addons     6.6.1
      PySide6-Essentials 6.6.1
      PyYAML             6.0.1
      requests           2.31.0
      setuptools         68.2.0
      shiboken6          6.6.1
      smmap              5.0.1
      typing_extensions  4.10.0
      urllib3            2.2.1
      wheel              0.41.2

      PS C:\Users\mplichta\Projects\dcspy> python scratch_15.py

      working!
      done!

      PS C:\Users\mplichta\Projects\dcspy> pip install -U Pyside6                 

      Looking in indexes: https://pkgs.dev.azure.com/pypi/simple/
      Requirement already satisfied: Pyside6 in c:\users\mplichta\projects\venvs\dcspy_311\lib\site-packages (6.6.1)
      Collecting Pyside6
        Downloading https://pkgs.dev.azure.com/pypi/download/pyside6/6.6.2/PySide6-6.6.2-cp38-abi3-win_amd64.whl (519 kB)
           ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 519.0/519.0 kB 147.3 kB/s eta 0:00:00
      Collecting shiboken6==6.6.2 (from Pyside6)
        Downloading https://pkgs.dev.azure.com/pypi/download/shiboken6/6.6.2/shiboken6-6.6.2-cp38-abi3-win_amd64.whl (1.1 MB)
           ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.1/1.1 MB 98.1 kB/s eta 0:00:00
      Collecting PySide6-Essentials==6.6.2 (from Pyside6)
        Downloading https://pkgs.dev.azure.com/pypi/download/pyside6-essentials/6.6.2/PySide6_Essentials-6.6.2-cp38-abi3-win_amd64.whl (77.2 MB)
           ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 77.2/77.2 MB 290.9 kB/s eta 0:00:00
      Collecting PySide6-Addons==6.6.2 (from Pyside6)
        Downloading https://pkgs.dev.azure.com/pypi/download/pyside6-addons/6.6.2/PySide6_Addons-6.6.2-cp38-abi3-win_amd64.whl (110.8 MB)
           ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 110.8/110.8 MB 230.5 kB/s eta 0:00:00
      Installing collected packages: shiboken6, PySide6-Essentials, PySide6-Addons, Pyside6
        Attempting uninstall: shiboken6
          Found existing installation: shiboken6 6.6.1
          Uninstalling shiboken6-6.6.1:
            Successfully uninstalled shiboken6-6.6.1
        Attempting uninstall: PySide6-Essentials
          Found existing installation: PySide6-Essentials 6.6.1
          Uninstalling PySide6-Essentials-6.6.1:
            Successfully uninstalled PySide6-Essentials-6.6.1
        Attempting uninstall: PySide6-Addons
          Found existing installation: PySide6-Addons 6.6.1
          Uninstalling PySide6-Addons-6.6.1:
            Successfully uninstalled PySide6-Addons-6.6.1
        Attempting uninstall: Pyside6
          Found existing installation: PySide6 6.6.1
          Uninstalling PySide6-6.6.1:
            Successfully uninstalled PySide6-6.6.1
      Successfully installed PySide6-Addons-6.6.2 PySide6-Essentials-6.6.2 Pyside6-6.6.2 shiboken6-6.6.2

      PS C:\Users\mplichta\Projects\dcspy> pip list

      Package            Version
      ------------------ --------
      annotated-types    0.6.0
      certifi            2024.2.2
      cffi               1.16.0
      charset-normalizer 3.3.2
      gitdb              4.0.11
      GitPython          3.1.42
      idna               3.6
      packaging          23.2
      pillow             10.2.0
      pip                24.0
      psutil             5.9.8
      pycparser          2.21
      pydantic           2.6.2
      pydantic_core      2.16.3
      PySide6            6.6.2
      PySide6_Addons     6.6.2
      PySide6_Essentials 6.6.2
      PyYAML             6.0.1
      requests           2.31.0
      setuptools         68.2.0
      shiboken6          6.6.2
      smmap              5.0.1
      typing_extensions  4.10.0
      urllib3            2.2.1
      wheel              0.41.2

      But after upgrading to 6.6.2:
      PS C:\Users\mplichta\Projects\dcspy> python scratch_15.py

      Traceback (most recent call last):
        File "signature_bootstrap.py", line 77, in bootstrap
        File "signature_bootstrap.py", line 93, in find_incarnated_files
        File "C:\Users\mplichta\.pyenv\pyenv-win\versions\3.11.7\Lib\pathlib.py", line 871, in _new_
          self = cls._from_parts(args)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\mplichta\.pyenv\pyenv-win\versions\3.11.7\Lib\pathlib.py", line 509, in _from_parts
          drv, root, parts = self._parse_args(args)
                             ^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\mplichta\.pyenv\pyenv-win\versions\3.11.7\Lib\pathlib.py", line 493, in _parse_args
          a = os.fspath(a)
              ^^^^^^^^^^^^
      TypeError: expected str, bytes or os.PathLike object, not NoneType
      Fatal Python error: could not initialize part 2
      Python runtime state: initialized
      Current thread 0x0000281c (most recent call first):
        File "<frozen importlib._bootstrap>", line 241 in _call_with_frames_removed
        File "<frozen importlib._bootstrap_external>", line 1233 in create_module
        File "<frozen importlib._bootstrap>", line 573 in module_from_spec
        File "<frozen importlib._bootstrap>", line 676 in _load_unlocked
        File "<frozen importlib._bootstrap>", line 1147 in _find_and_load_unlocked
        File "<frozen importlib._bootstrap>", line 1176 in _find_and_load
        File "<frozen importlib._bootstrap>", line 241 in _call_with_frames_removed
        File "<frozen importlib._bootstrap>", line 1232 in _handle_fromlist
        File "C:\Users\mplichta\Projects\venvs\dcspy_311\Lib\site-packages\PySide6_init_.py", line 64 in _setupQtDirectories
        File "C:\Users\mplichta\Projects\venvs\dcspy_311\Lib\site-packages\PySide6_init_.py", line 124 in <module>
        File "<frozen importlib._bootstrap>", line 241 in _call_with_frames_removed
        File "<frozen importlib._bootstrap_external>", line 940 in exec_module
        File "<frozen importlib._bootstrap>", line 690 in _load_unlocked
        File "<frozen importlib._bootstrap>", line 1147 in _find_and_load_unlocked
        File "<frozen importlib._bootstrap>", line 1176 in _find_and_load
        File "<frozen importlib._bootstrap>", line 241 in _call_with_frames_removed
        File "<frozen importlib._bootstrap>", line 1126 in _find_and_load_unlocked
        File "<frozen importlib._bootstrap>", line 1176 in _find_and_load
        File "C:\Users\mplichta\AppData\Roaming\JetBrains\PyCharm2023.3\scratches\scratch_15.py", line 1 in <module>
      Extension modules: xxsubtype (total: 1)
      

       

       

      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
              emc Michał Plichta
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes