pyqt-bundle: TypeError: 'module' object is not callable

Florian Bruhin me at the-compiler.org
Wed Sep 3 14:36:42 BST 2025


Hey,

With pyqt_builder-1.18.2 and Python 3.13.7 on Linux, when running

    pyqt-bundle --verbose --ignore-missing --qt-dir ~/proj/qt/bin/6.10.0/gcc_64 pyqt6-6.9.1-cp39-abi3-manylinux_2_28_x86_64.whl 

I get:

    pyqt-bundle: An internal error occurred...
    Traceback (most recent call last):
      File ".../.venv/bin/pyqt-bundle", line 7, in <module>
        sys.exit(main())
                 ~~~~^^
      File ".../.venv/lib/python3.13/site-packages/pyqtbuild/bundle/bundle_main.py", line 77, in main
        handle_exception(e)
        ~~~~~~~~~~~~~~~~^^^
      File ".../.venv/lib/python3.13/site-packages/sipbuild/exceptions.py", line 76, in handle_exception
        raise e
      File ".../.venv/lib/python3.13/site-packages/pyqtbuild/bundle/bundle_main.py", line 71, in main
        bundle(wheel_path=args.wheels[0], qt_dir=args.qt_dir,
        ~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                build_tag_suffix=args.build_tag_suffix,
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                msvc_runtime=args.msvc_runtime, openssl=args.openssl,
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                openssl_dir=args.openssl_dir, exclude=args.exclude,
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                ignore_missing=args.ignore_missing, arch=arch)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File ".../.venv/lib/python3.13/site-packages/pyqtbuild/bundle/bundle.py", line 65, in bundle
        package = package_factory(qt_dir, parts[1])
    TypeError: 'module' object is not callable

The involved objects:

(Pdb) package_name
'pyqt6'
(Pdb) packages
<module 'pyqtbuild.bundle.packages' from '.../.venv/lib/python3.13/site-packages/pyqtbuild/bundle/packages/__init__.py'>
(Pdb) packages.__dict__["pyqt6"]
<module 'pyqtbuild.bundle.packages.pyqt6' from '.../.venv/lib/python3.13/site-packages/pyqtbuild/bundle/packages/pyqt6.py'>

I think the code should be accessing the PyQt6 class in there
(camel-case in packages.__dict__) rather than the module object
(lower-case in packages.__dict__)?

Yet the PyQt 6.9.1 wheel is all-lowercase:
https://pypi.org/project/PyQt6/6.9.1/#files

Which I believe is correct according to packaging standards:
https://packaging.python.org/en/latest/specifications/name-normalization/

And indeed, as a workaround, renaming the wheel works:
mv {pyqt6,PyQt6}-6.9.1-cp39-abi3-manylinux_2_28_x86_64.whl

Florian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20250903/4f047f0d/attachment.sig>


More information about the PyQt mailing list