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

Unable to import shiboken2 with cx_freeze executable

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • P3: Somewhat important
    • None
    • 5.14.2.1, 5.14.2.2
    • PySide, Shiboken
    • None
    • Windows 10 x86_64
      Python V3.8.3
      cx_freeze V6.1
      PySide2 5.14.2.3
    • Windows

    Description

      Hello Team,

      It's been several days that I block on a problem between PySide2 and cx_freeze...
      When I freeze my application, I get the following error when launching the executable:

      test-gui.exe
      PySide2/__init__.py: Unable to import shiboken2 from L:\dev\PROJECT\bin\windows, L:\dev\PROJECT\bin\windows\lib\library.zip, L:\dev\PROJECT\bin\windows\lib
      Traceback (most recent call last):
        File "I:\REF\COTS\PYTHON\V3.8.3\BINARIES\Windows\lib\site-packages\cx_Freeze\initscripts\__startup__.py", line 40, in run
          module.run()
        File "I:\REF\COTS\PYTHON\V3.8.3\BINARIES\Windows\lib\site-packages\cx_Freeze\initscripts\Console.py", line 37, in run
          exec(code, {'__name__': '__main__'})
        File "test-cli.py", line 1, in <module>
        File "<frozen zipimport>", line 259, in load_module
        File "I:\REF\COTS\PYTHON\V3.8.3\BINARIES\Windows\lib\site-packages\PySide2\__init__.py", line 91, in <module>
          _setupQtDirectories()
        File "I:\REF\COTS\PYTHON\V3.8.3\BINARIES\Windows\lib\site-packages\PySide2\__init__.py", line 57, in _setupQtDirectories
          import shiboken2
        File "<frozen zipimport>", line 259, in load_module
        File "I:\REF\COTS\PYTHON\V3.8.3\BINARIES\Windows\lib\site-packages\shiboken2\__init__.py", line 27, in <module>
          from .shiboken2 import *
      ImportError: DLL load failed while importing shiboken2: The specified module could not be found.
      

      Everything works fine by directly calling the Python script as follows:

      python test-gui.py
      

      I tried with the following version of Pyside2: 5.14.2.1, 5.14.2.2 and 5.14.2.3.

      Attachments

        1. pyside1408.zip
          3 kB
          Friedemann Kleint
        2. setup.py
          4 kB
          Louis-Andréa SALBAN
        3. test-cli.py
          0.1 kB
          Louis-Andréa SALBAN
        4. test-gui.py
          0.1 kB
          Louis-Andréa SALBAN

        Issue Links

          Activity

            People

              crmaurei Cristian Maureira-Fredes
              lois Louis-Andréa SALBAN
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: