I am trying to get PyQt6 to install on my Jetson Orin Nano with the latest Jetpack 6.2.1. I am using pip install PyQt6.
I have compiled QT6 from source qt-everywhere-src-6.9.1.tar.xz.
If I have my QT6 directory /opt/qt6.9.1/bin in the PATH, it fails. When I try to run pip install PyQt6, it crashes the device and it reboots. It is getting stuck at the beginning at:
Preparing metadata (pyproject.toml) … \
After 5 minutes, the Orin reboots on it’s own.
If, however, I remove the QT6 directory from the PATH, I get the following errors:
$ pip install PyQt6
Defaulting to user installation because normal site-packages is not writeable
Collecting PyQt6
Using cached pyqt6-6.9.1.tar.gz (1.1 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... error
error: subprocess-exited-with-error
× Preparing metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [27 lines of output]
Querying qmake about your Qt installation...
Traceback (most recent call last):
File "/home/gensight/.local/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 389, in <module>
main()
File "/home/gensight/.local/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 373, in main
json_out["return_val"] = hook(**hook_input["kwargs"])
File "/home/gensight/.local/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 178, in prepare_metadata_for_build_wheel
whl_basename = backend.build_wheel(metadata_directory, config_settings)
File "/tmp/pip-build-env-37p2isak/overlay/local/lib/python3.10/dist-packages/sipbuild/api.py", line 28, in build_wheel
project = AbstractProject.bootstrap('wheel',
File "/tmp/pip-build-env-37p2isak/overlay/local/lib/python3.10/dist-packages/sipbuild/abstract_project.py", line 74, in bootstrap
project.setup(pyproject, tool, tool_description)
File "/tmp/pip-build-env-37p2isak/overlay/local/lib/python3.10/dist-packages/sipbuild/project.py", line 633, in setup
self.apply_user_defaults(tool)
File "/tmp/pip-install-4v004gb9/pyqt6_e702d23f7d7d4854875ef7fbabf96209/project.py", line 66, in apply_user_defaults
super().apply_user_defaults(tool)
File "/tmp/pip-build-env-37p2isak/overlay/local/lib/python3.10/dist-packages/pyqtbuild/project.py", line 51, in apply_user_defaults
super().apply_user_defaults(tool)
File "/tmp/pip-build-env-37p2isak/overlay/local/lib/python3.10/dist-packages/sipbuild/project.py", line 243, in apply_user_defaults
self.builder.apply_user_defaults(tool)
File "/tmp/pip-build-env-37p2isak/overlay/local/lib/python3.10/dist-packages/pyqtbuild/builder.py", line 58, in apply_user_defaults
self._get_qt_configuration()
File "/tmp/pip-build-env-37p2isak/overlay/local/lib/python3.10/dist-packages/pyqtbuild/builder.py", line 483, in _get_qt_configuration
for line in project.read_command_pipe([self.qmake, '-query']):
File "/tmp/pip-build-env-37p2isak/overlay/local/lib/python3.10/dist-packages/sipbuild/project.py", line 600, in read_command_pipe
raise UserException(
sipbuild.exceptions.UserException
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
To build the QT6 for my device I used the following parameters:
../configure -prefix /opt/qt6.9.1 \
-platform linux-g++ \
-nomake examples \
-nomake tests \
-nomake benchmarks \
-opensource -confirm-license \
-bundled-xcb-xinput -xcb -xcb-xlib \
-skip qt3d \
-skip qtconnectivity \
-skip qtdatavis3d \
-skip qtgamepad \
-skip qtlottie \
-skip qtnetworkauth \
-skip qtquicktimeline \
-skip qtsensors \
-skip qtspeech \
-skip qtwebchannel \
-skip qtwebengine \
-skip qtwebglplugin
build_cores=`expr $(nproc) - 1`
cmake --build . -j$build_cores
Before I ran cmake, I had to comment the following line:
vi ../qtdeclarative/tests/auto/qml/qqmljsscope/QqmlJSScopeTests/extensiontypes.h
Comment line 129
The build was successful and I was able to run qtdiag but I still cannot install PyQt6.
Note: I can actually import PyQt6 but not any submodules like PyQt6.QtGui or PyQt6.QtCore, I get ModuleNotFoundError: No module named ‘PyQt6.QtGui’
Any help would be appreciated. For instance: how do I troubleshoot the reboot because the logs ‘refresh’ after the boot process? Why is the pyproject.toml process failing?