When I try to run an application that depends on pyqt5, I get an error.
Traceback (most recent call last):
File "/home/maddy/.local/share/mise/installs/pipx-git-https-github-com-maddy-guthridge-pyqtprotractor-git/master/bin/pyqtprotractor", line 6, in <module>
from pyqtprotractor import main
File "/home/maddy/.local/share/mise/installs/pipx-git-https-github-com-maddy-guthridge-pyqtprotractor-git/master/pyqtprotractor/lib/python3.14/site-packages/pyqtprotractor/__init__.py", line 25, in <module>
from PyQt5.Qt import Qt, QApplication, QWidget
ImportError: cannot import name 'Qt' from 'PyQt5.Qt' (/home/maddy/.local/share/mise/installs/pipx-git-https-github-com-maddy-guthridge-pyqtprotractor-git/master/pyqtprotractor/lib/python3.14/site-packages/PyQt5/Qt.abi3.so)
However, when I try to set up a nix shell using uv2nix, I get this horrific build error:
error: builder for '/nix/store/7yq54fkclm0zljphj0li6hdyja2k11fs-pyqt5-5.15.11.drv' failed with exit code 1;
last 25 log lines:
> error: auto-patchelf could not satisfy dependency libQt5Qml.so.5 wanted by /nix/store/4b0ra527svdaxgh6w4sddip27lsx52md-pyqt5-5.15.11/lib/python3.12/site-packages/PyQt5/QtQml.abi3.so
> error: auto-patchelf could not satisfy dependency libQt5Network.so.5 wanted by /nix/store/4b0ra527svdaxgh6w4sddip27lsx52md-pyqt5-5.15.11/lib/python3.12/site-packages/PyQt5/QtQml.abi3.so
> error: auto-patchelf could not satisfy dependency libQt5Core.so.5 wanted by /nix/store/4b0ra527svdaxgh6w4sddip27lsx52md-pyqt5-5.15.11/lib/python3.12/site-packages/PyQt5/QtQml.abi3.so
> error: auto-patchelf could not satisfy dependency libQt5MultimediaWidgets.so.5 wanted by /nix/store/4b0ra527svdaxgh6w4sddip27lsx52md-pyqt5-5.15.11/lib/python3.12/site-packages/PyQt5/QtMultimediaWidgets.abi3.so
> error: auto-patchelf could not satisfy dependency libQt5Multimedia.so.5 wanted by /nix/store/4b0ra527svdaxgh6w4sddip27lsx52md-pyqt5-5.15.11/lib/python3.12/site-packages/PyQt5/QtMultimediaWidgets.abi3.so
> error: auto-patchelf could not satisfy dependency libQt5Widgets.so.5 wanted by /nix/store/4b0ra527svdaxgh6w4sddip27lsx52md-pyqt5-5.15.11/lib/python3.12/site-packages/PyQt5/QtMultimediaWidgets.abi3.so
> error: auto-patchelf could not satisfy dependency libQt5Gui.so.5 wanted by /nix/store/4b0ra527svdaxgh6w4sddip27lsx52md-pyqt5-5.15.11/lib/python3.12/site-packages/PyQt5/QtMultimediaWidgets.abi3.so
> error: auto-patchelf could not satisfy dependency libQt5Network.so.5 wanted by /nix/store/4b0ra527svdaxgh6w4sddip27lsx52md-pyqt5-5.15.11/lib/python3.12/site-packages/PyQt5/QtMultimediaWidgets.abi3.so
> error: auto-patchelf could not satisfy dependency libQt5Core.so.5 wanted by /nix/store/4b0ra527svdaxgh6w4sddip27lsx52md-pyqt5-5.15.11/lib/python3.12/site-packages/PyQt5/QtMultimediaWidgets.abi3.so
> error: auto-patchelf could not satisfy dependency libQt5Location.so.5 wanted by /nix/store/4b0ra527svdaxgh6w4sddip27lsx52md-pyqt5-5.15.11/lib/python3.12/site-packages/PyQt5/QtLocation.abi3.so
> error: auto-patchelf could not satisfy dependency libQt5PositioningQuick.so.5 wanted by /nix/store/4b0ra527svdaxgh6w4sddip27lsx52md-pyqt5-5.15.11/lib/python3.12/site-packages/PyQt5/QtLocation.abi3.so
> error: auto-patchelf could not satisfy dependency libQt5Quick.so.5 wanted by /nix/store/4b0ra527svdaxgh6w4sddip27lsx52md-pyqt5-5.15.11/lib/python3.12/site-packages/PyQt5/QtLocation.abi3.so
> error: auto-patchelf could not satisfy dependency libQt5Gui.so.5 wanted by /nix/store/4b0ra527svdaxgh6w4sddip27lsx52md-pyqt5-5.15.11/lib/python3.12/site-packages/PyQt5/QtLocation.abi3.so
> error: auto-patchelf could not satisfy dependency libQt5Positioning.so.5 wanted by /nix/store/4b0ra527svdaxgh6w4sddip27lsx52md-pyqt5-5.15.11/lib/python3.12/site-packages/PyQt5/QtLocation.abi3.so
> error: auto-patchelf could not satisfy dependency libQt5QmlModels.so.5 wanted by /nix/store/4b0ra527svdaxgh6w4sddip27lsx52md-pyqt5-5.15.11/lib/python3.12/site-packages/PyQt5/QtLocation.abi3.so
> error: auto-patchelf could not satisfy dependency libQt5Qml.so.5 wanted by /nix/store/4b0ra527svdaxgh6w4sddip27lsx52md-pyqt5-5.15.11/lib/python3.12/site-packages/PyQt5/QtLocation.abi3.so
> error: auto-patchelf could not satisfy dependency libQt5Network.so.5 wanted by /nix/store/4b0ra527svdaxgh6w4sddip27lsx52md-pyqt5-5.15.11/lib/python3.12/site-packages/PyQt5/QtLocation.abi3.so
> error: auto-patchelf could not satisfy dependency libQt5Core.so.5 wanted by /nix/store/4b0ra527svdaxgh6w4sddip27lsx52md-pyqt5-5.15.11/lib/python3.12/site-packages/PyQt5/QtLocation.abi3.so
> error: auto-patchelf could not satisfy dependency libQt5Gui.so.5 wanted by /nix/store/4b0ra527svdaxgh6w4sddip27lsx52md-pyqt5-5.15.11/lib/python3.12/site-packages/PyQt5/_QOpenGLFunctions_4_1_Core.abi3.so
> error: auto-patchelf could not satisfy dependency libQt5Core.so.5 wanted by /nix/store/4b0ra527svdaxgh6w4sddip27lsx52md-pyqt5-5.15.11/lib/python3.12/site-packages/PyQt5/_QOpenGLFunctions_4_1_Core.abi3.so
> error: auto-patchelf could not satisfy dependency libQt5Gui.so.5 wanted by /nix/store/4b0ra527svdaxgh6w4sddip27lsx52md-pyqt5-5.15.11/lib/python3.12/site-packages/PyQt5/QtBluetooth.abi3.so
> error: auto-patchelf could not satisfy dependency libQt5Bluetooth.so.5 wanted by /nix/store/4b0ra527svdaxgh6w4sddip27lsx52md-pyqt5-5.15.11/lib/python3.12/site-packages/PyQt5/QtBluetooth.abi3.so
> error: auto-patchelf could not satisfy dependency libQt5Core.so.5 wanted by /nix/store/4b0ra527svdaxgh6w4sddip27lsx52md-pyqt5-5.15.11/lib/python3.12/site-packages/PyQt5/QtBluetooth.abi3.so
> auto-patchelf failed to find all the required dependencies.
> Add the missing dependencies to --libs or use `--ignore-missing="foo.so.1 bar.so etc.so"`.
For full logs, run:
nix log /nix/store/7yq54fkclm0zljphj0li6hdyja2k11fs-pyqt5-5.15.11.drv
[2/6/11 built (1 failed), 0.0 MiB DL] building pyqt5-5.15.11 (fixupPhase): Add the missing dependeerror: 1 dependencies of derivation '/nix/store/1882bzm57dhs6g66b0y1x1cqq560lf73-pyqtprotractor-dev-env.drv' failed to build
error: 1 dependencies of derivation '/nix/store/gaqhqs0yhzl5rq9m17alsjkvxi300r51-nix-shell-env.drv' failed to build
When I try to create a Nix shell with the same dependency, I do not get errors.
$ nix-shell -p python3Packages.pyqt5
[nix-shell:~/Source/pyqtprotractor]$ python -c 'import PyQt5'
[nix-shell:~/Source/pyqtprotractor]$
For reference, here is my flake, which is based on the template from uv2nix. pyqtprotractor/flake.nix at master · MaddyGuthridge/pyqtprotractor · GitHub