New installation of pyqt6

I am trying to install pyqt6 in a new virtual environment using: pip3 install pyqt6

The virtual environment is activated

I get the following error:

Using cached pyqt6-6.10.0.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
╰─> [25 lines of output]
Traceback (most recent call last):
File “/home/rpi5/p1venv/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py”, line 353, in
main()
File “/home/rpi5/p1venv/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py”, line 335, in main
json_out[‘return_val’] = hook(**hook_input[‘kwargs’])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/rpi5/p1venv/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py”, line 152, in prepare_metadata_for_build_wheel
whl_basename = backend.build_wheel(metadata_directory, config_settings)

Using cached pyqt6-6.10.0.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
╰─> [25 lines of output]
Traceback (most recent call last):
File “/home/rpi5/p1venv/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py”, line 353, in
main()
File “/home/rpi5/p1venv/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py”, line 335, in main
json_out[‘return_val’] = hook(**hook_input[‘kwargs’])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/rpi5/p1venv/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py”, line 152, in prepare_metadata_for_build_wheel
whl_basename = backend.build_wheel(metadata_directory, config_settings)

Hi @Ahmad what platform are you trying to install it on? Is it a Raspberry Pi (just going off the username rpi5). If so, you could also try:

sudo apt install python3-pyqt6 

(although this will install it into the system Python not your venv).