Python Forum
[PyQt] error in trying to install pyqt5
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PyQt] error in trying to install pyqt5
#1
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
Larz60+ write Jan-13-2025, 07:08 AM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
using Ubuntu 18.04.4 LTS, Python 3.8
having substituted «https://www.lilo.org/fr/» to google, «https://protonmail.com/» to any other unsafe mail service and bépo to azerty (french keyboard layouts)
Reply
#2
You can try installing the pyqt5 package with
sudo apt install python3-pyqt5
Reply
#3
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
Reply
#4
Hi

I installed using

sudo apt-get install python3-pyqt5

and it works.

Thank you to both of you

Arbiel
using Ubuntu 18.04.4 LTS, Python 3.8
having substituted «https://www.lilo.org/fr/» to google, «https://protonmail.com/» to any other unsafe mail service and bépo to azerty (french keyboard layouts)
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Unable to install PyQt5 using pip. edwin4project 2 4,359 Nov-06-2020, 06:53 PM
Last Post: Larz60+
  PyQt5 Error Harshil 4 4,065 Aug-20-2020, 12:24 PM
Last Post: Axel_Erfurt
  Huge code problems (buttons(PyQt5),PyQt5 Threads, Windows etc) ZenWoR 0 3,467 Apr-06-2019, 11:15 PM
Last Post: ZenWoR
  [PyQt] how to install pyqt5 for python 3.5.2 64bit lemonred 2 22,982 Oct-28-2016, 03:25 PM
Last Post: lemonred

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020