pyqt6-tools designer: No module named 'pkg_resources' (fix)

pyqt6-tools 6.4.2.3.3 (the latest) does import pkg_resources in pyqt6_tools/__init__.py, so pyqt6-tools designer fails with ModuleNotFoundError: No module named 'pkg_resources' on setuptools 82+ or in a venv without setuptools. Tested fix: pip install "setuptools<81".

1. The error: pyqt6-tools 6.4.2.3.3 with setuptools 84

pip install pyqt6-tools (6.4.2.3.3, the latest, 2023-03-27; it pulled in qt6-tools, qt6-applications and pyqt6-plugins) into a Python 3.11.17 venv, then pip install setuptools==84.2.1:

$ pyqt6-tools --help
Traceback (most recent call last):
  File "/path/to/venv/bin/pyqt6-tools", line 4, in <module>
    from pyqt6_tools.entrypoints import main
  File "pyqt6_tools/__init__.py", line 7, in <module>
    import pkg_resources
ModuleNotFoundError: No module named 'pkg_resources'

pyqt6_tools/__init__.py line 7 is a plain import pkg_resources, and setuptools 82.0.0 removed that module. So pyqt6-tools designer fails before Designer starts. We got the same traceback before installing setuptools at all: venvs made by uv venv, and python -m venv on Python 3.12 and newer, have no setuptools by default.

Switching to the qt6-tools command does not help. It fails the same way, one level deeper:

$ qt6-tools designer --help
...
Traceback (most recent call last):
  File "/path/to/venv/bin/qt6-tools", line 4, in <module>
    from qt6_tools.entrypoints import main
  File "qt6_tools/__init__.py", line 24, in <module>
    qt_applications = import_it("qt_applications")
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "qt6_tools/__init__.py", line 9, in import_it
    import pkg_resources
ModuleNotFoundError: No module named 'pkg_resources'

2. Fix: pin setuptools below 81 (tested)

$ pip install "setuptools<81"    # gave 80.10.2
$ pyqt6-tools --help
pyqt6_tools/__init__.py:7: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
  import pkg_resources
Usage: pyqt6-tools [OPTIONS] COMMAND [ARGS]...

Options:
  --help  Show this message and exit.

Commands:
  designer
  installuic
  qmlscene
  qmltestrunner

pyqt6-tools designer --help also worked after the pin. No newer pyqt6-tools release exists, and pyqt6_plugins, qt6_tools and qt6_applications all import pkg_resources too, so keep setuptools<81 in this environment. The pkg_resources is deprecated warning above is harmless. To hide it, set PYTHONWARNINGS="ignore:pkg_resources is deprecated as an API".

3. Or skip the wrapper: the Designer binary is already installed

The wrapper commands only locate and start the Qt executables shipped in qt6-applications. In our Linux venv, Designer was at:

/path/to/venv/lib/python3.11/site-packages/qt6_applications/Qt/bin/designer

On Windows, look for designer.exe under Lib\site-packages\qt6_applications\Qt\bin\. Running it directly needs no Python and no pkg_resources. We only checked that the file exists; we did not open the GUI in this run. If you use the wrapper's --widget-path or the example plugins, keep the wrapper and the setuptools pin.

Related: No module named 'pkg_resources' (general fix) · pyqt5-tools (same fix) · pygame warning.

Frequently asked questions

Does qt6-tools designer avoid the error?

No. In our test qt6-tools designer failed with the same ModuleNotFoundError, from qt6_tools/__init__.py line 9.

Why does a fresh venv hit this?

uv venv, and python -m venv on Python 3.12+, create environments without setuptools, so pkg_resources is missing even before any upgrade.

Written with AI assistance. Measured on 2026-10-24 on Linux with pyqt6-tools 6.4.2.3.3, qt6-tools 6.4.3.1.3, PyQt6 6.4.2, CPython 3.11.17, setuptools 80.10.2 and 84.2.1. Output pasted unedited except shortened paths. PlainTables is our extension; pyqt6-tools is free.