Python Forum

Full Version: error in trying to install pyqt5
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi

Trying to install PyQt5, I get the following message :

arbiel@arbiel-NJ5x-NJ7xLU:~$ pip install PyQt5
Collecting PyQt5
Using cached PyQt5-5.15.11.tar.gz (3.2 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing wheel metadata ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 /tmp/tmptt_0nxqr prepare_metadata_for_build_wheel /tmp/tmpr8h5fbva
cwd: /tmp/pip-install-hcz7ybzz/PyQt5
Complete output (31 lines):
Traceback (most recent call last):
File "/tmp/tmptt_0nxqr", line 126, in prepare_metadata_for_build_wheel
hook = backend.prepare_metadata_for_build_wheel
AttributeError: module 'sipbuild.api' has no attribute 'prepare_metadata_for_build_wheel'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/tmp/tmptt_0nxqr", line 280, in <module>
main()
File "/tmp/tmptt_0nxqr", line 263, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/tmp/tmptt_0nxqr", line 130, in prepare_metadata_for_build_wheel
return _get_wheel_metadata_from_wheel(backend, metadata_directory,
File "/tmp/tmptt_0nxqr", line 159, in _get_wheel_metadata_from_wheel
whl_basename = backend.build_wheel(metadata_directory, config_settings)
File "/tmp/pip-build-env-72i1tb5k/overlay/lib/python3.8/site-packages/sipbuild/api.py", line 28, in build_wheel
project = AbstractProject.bootstrap('wheel',
File "/tmp/pip-build-env-72i1tb5k/overlay/lib/python3.8/site-packages/sipbuild/abstract_project.py", line 74, in bootstrap
project.setup(pyproject, tool, tool_description)
File "/tmp/pip-build-env-72i1tb5k/overlay/lib/python3.8/site-packages/sipbuild/project.py", line 608, in setup
self.apply_user_defaults(tool)
File "/tmp/pip-install-hcz7ybzz/PyQt5/project.py", line 68, in apply_user_defaults
super().apply_user_defaults(tool)
File "/tmp/pip-build-env-72i1tb5k/overlay/lib/python3.8/site-packages/pyqtbuild/project.py", line 51, in apply_user_defaults
super().apply_user_defaults(tool)
File "/tmp/pip-build-env-72i1tb5k/overlay/lib/python3.8/site-packages/sipbuild/project.py", line 237, in apply_user_defaults
self.builder.apply_user_defaults(tool)
File "/tmp/pip-build-env-72i1tb5k/overlay/lib/python3.8/site-packages/pyqtbuild/builder.py", line 49, in apply_user_defaults
raise PyProjectOptionException('qmake',
sipbuild.pyproject.PyProjectOptionException
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 /tmp/tmptt_0nxqr prepare_metadata_for_build_wheel /tmp/tmpr8h5fbva Check the logs for full command output.
arbiel@arbiel-NJ5x-NJ7xLU:~$


I understand I should check the logs to get more information. However I don't know their localisation.

Thanks to anybody indicating where I can check the logs.

I running Python 3.8.10 under Ubuntu VERSION="20.04.6 LTS (Focal Fossa)"

Arbiel
You can try installing the pyqt5 package with
sudo apt install python3-pyqt5
I recently installed PyQt5 and PyQt6. I'll admit up front that I had to look up this stuff. Searching my command history I see that I used this for PyQt5:

sudo apt-get install python3-pyqt5
And I have written Python scripts with PyQt5, so it must have worked.

I used the same command for PyQt6:

sudo apt install python3-pyqt6
But that didn't work and I had to use this instead:

pip3 install pyqt6
Hi

I installed using

sudo apt-get install python3-pyqt5

and it works.

Thank you to both of you

Arbiel