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

macOS: pyside6-deploy fails to deploy libqsqlpsql.dylib

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4: Low
    • None
    • 6.7.2
    • Tooling
    • macOS 13.5.2, Python 3.11
    • macOS
    • 57b7a13a3 (dev), 8c2107c33 (6.7)

    Description

      Code
      Just a simple app that uses PySide6.QtSql

      # main.py
      import sys
      from PySide6.QtWidgets import QApplication
      from PySide6.QtSql import QSqlQuery
      
      if __name__ == "__main__":
          app = QApplication(sys.argv)
          query = QSqlQuery()
          sys.exit(app.exec())
      

       

      Outcome of `pyside6-deploy main.py`

      FATAL:     Error, problem with dependency scan of '~/py-venv/py3.11-pyside6.7/lib/python3.11/site-packages/PySide6/Qt/plugins/sqldrivers/libqsqlpsql.dylib' with '/Applications/Postgres.app/Contents/Versions/14/lib/libpq.5.dylib' please report the bug.
      [DEPLOY] Exception occurred: Traceback (most recent call last):
        File "/Users/USER/py-venv/py3.11-pyside6.7/lib/python3.11/site-packages/PySide6/scripts/deploy_lib/commands.py", line 24, in run_command
          subprocess.check_call(command, shell=is_windows)
        File "/opt/homebrew/Cellar/python@3.11/3.11.9/Frameworks/Python.framework/Versions/3.11/lib/python3.11/subprocess.py", line 413, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '[PosixPath('/Users/USER/py-venv/py3.11-pyside6.7/bin/python'), '-m', 'nuitka', '/Users/USER/testproject/main.py', '--follow-imports', '--enable-plugin=pyside6', '--output-dir=/Users/USER/testproject/deployment', '--quiet', '--noinclude-qt-translations', '--standalone', '--macos-create-app-bundle', '--macos-app-icon=/Users/USER/py-venv/py3.11-pyside6.7/lib/python3.11/site-packages/PySide6/scripts/deploy_lib/pyside_icon.icns', '--include-qt-plugins=accessiblebridge,platforminputcontexts,platforms/darwin,sqldrivers']' returned non-zero exit status 1.
      
      During handling of the above exception, another exception occurred:
      
      Traceback (most recent call last):
        File "/Users/USER/py-venv/py3.11-pyside6.7/lib/python3.11/site-packages/PySide6/scripts/deploy.py", line 131, in main
          command_str = nuitka.create_executable(source_file=config.source_file,
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/Users/USER/py-venv/py3.11-pyside6.7/lib/python3.11/site-packages/PySide6/scripts/deploy_lib/nuitka_helper.py", line 103, in create_executable
          command_str, _ = run_command(command=command, dry_run=dry_run)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/Users/USER/py-venv/py3.11-pyside6.7/lib/python3.11/site-packages/PySide6/scripts/deploy_lib/commands.py", line 30, in run_command
          raise RuntimeError(
      RuntimeError: [DEPLOY] Command /Users/USER/py-venv/py3.11-pyside6.7/bin/python -m nuitka /Users/USER/testproject/main.py --follow-imports --enable-plugin=pyside6 --output-dir=/Users/USER/testproject/deployment --quiet --noinclude-qt-translations --standalone --macos-create-app-bundle --macos-app-icon=/Users/USER/py-venv/py3.11-pyside6.7/lib/python3.11/site-packages/PySide6/scripts/deploy_lib/pyside_icon.icns --include-qt-plugins=accessiblebridge,platforminputcontexts,platforms/darwin,sqldrivers failed with error Command '[PosixPath('/Users/USER/py-venv/py3.11-pyside6.7/bin/python'), '-m', 'nuitka', '/Users/USER/testproject/main.py', '--follow-imports', '--enable-plugin=pyside6', '--output-dir=/Users/USER/testproject/deployment', '--quiet', '--noinclude-qt-translations', '--standalone', '--macos-create-app-bundle', '--macos-app-icon=/Users/USER/py-venv/py3.11-pyside6.7/lib/python3.11/site-packages/PySide6/scripts/deploy_lib/pyside_icon.icns', '--include-qt-plugins=accessiblebridge,platforminputcontexts,platforms/darwin,sqldrivers']' returned non-zero exit status 1. and return_code1
      
      [DEPLOY] Executed file created in /Users/USER/testproject/main.app
      

       

      Notes

      • Qt 6 requires macOS developers to install Postgres.app v14 (https://postgresapp.com/downloads.html) because libqsqlpsql.dylib as a hard dependency on
        /Applications/Postgres.app/Contents/Versions/14/lib/libpq.5.dylib. (macdeployqt patches the plugin to depend on an internal copy of libpq.5.dylib instead, but /Applications/Postgres.app/ is required to run without deployment)
      • Most of the SQL plugins have external dependencies, which if not present will also block pyside6-deploy from completing its job. Temporarily remove those plugins from PySide6/Qt/plugins/sqldrivers/ to avoid those dependencies.

      Attachments

        Issue Links

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

          Activity

            People

              shpremna Shyamnath Premnadh
              skoh-qt Sze Howe Koh
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes