1

I have been trying to install pyqt6 on my linux device! tried running:

pip install pyqt6
pip3 install pyqt6
python -m pip install pyqt6
python3 -m pip install pyqt6

and the variations of such commands. I also tried updating pip and python to latest versions it would give me (python 3.9.2 and pip 22.1.2)

error i get when installing pyqt6 is as follows:

  Defaulting to user installation because normal site-packages is not writeable
  Collecting pyqt6
  Using cached PyQt6-6.3.1.tar.gz (1.0 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
  ╰─> [29 lines of output]
      Traceback (most recent call last):
        File "/home/user1/.local/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 156, 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 "/home/user1/.local/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
          main()
        File "/home/user1/.local/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/home/user1/.local/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 160, in prepare_metadata_for_build_wheel
          whl_basename = backend.build_wheel(metadata_directory, config_settings)
        File "/tmp/pip-build-env-lb2ttoa7/overlay/lib/python3.9/site-packages/sipbuild/api.py", line 46, in build_wheel
          project = AbstractProject.bootstrap('wheel',
        File "/tmp/pip-build-env-lb2ttoa7/overlay/lib/python3.9/site-packages/sipbuild/abstract_project.py", line 87, in bootstrap
          project.setup(pyproject, tool, tool_description)
        File "/tmp/pip-build-env-lb2ttoa7/overlay/lib/python3.9/site-packages/sipbuild/project.py", line 584, in setup
          self.apply_user_defaults(tool)
        File "project.py", line 67, in apply_user_defaults
          super().apply_user_defaults(tool)
        File "/tmp/pip-build-env-lb2ttoa7/overlay/lib/python3.9/site-packages/pyqtbuild/project.py", line 70, in apply_user_defaults
          super().apply_user_defaults(tool)
        File "/tmp/pip-build-env-lb2ttoa7/overlay/lib/python3.9/site-packages/sipbuild/project.py", line 236, in apply_user_defaults
          self.builder.apply_user_defaults(tool)
        File "/tmp/pip-build-env-lb2ttoa7/overlay/lib/python3.9/site-packages/pyqtbuild/builder.py", line 67, in apply_user_defaults
          raise PyProjectOptionException('qmake',
      sipbuild.pyproject.PyProjectOptionException
      [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.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

Any help would be appreciated

edits: to answer comments (since i replied there by accident instead of updating: unsure what linux distro i'm running since it's the linux de available on chromebooks, if there's an official package for it I don't know what it is.

link 1 doesn't help just recommends i try steps i've done already such as updating pip

ekhumoro
  • 115,249
  • 20
  • 229
  • 336
  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. – Community Jul 17 '22 at 09:07
  • What linux distro are you using? Why don't you install the distro's official pyqt6 packages? – ekhumoro Jul 17 '22 at 10:37
  • Does this answer your question? [AttributeError: module 'sipbuild.api' has no attribute 'prepare\_metadata\_for\_build\_wheel' for PyQt5 5.15.0](https://stackoverflow.com/questions/65447314/attributeerror-module-sipbuild-api-has-no-attribute-prepare-metadata-for-bui) – ניר Jul 17 '22 at 11:53
  • unsure what linux distro i'm running since its the linux de available on chromebooks, if there's an official package for it I don't know what it is. That link doesn't help, just recommends i try steps i've done already such as updating pip – Harrison O'Donnell Jul 17 '22 at 20:09
  • 1
    @HarrisonO'Donnell The traceback indicates a problem with `qmake`, which is part of Qt6 (and obviously a dependency of PyQt6). It's possible there's a compatibility mismatch between the version of Qt6 pip is trying to install and your chrome-os. Please try running `pip install PyQt6-Qt6` to see if that gives more informative error output. You could also try `pip install PyQt5`, because if that succeeds, it would tend to confirm the compatibility problems with Qt6. – ekhumoro Jul 18 '22 at 14:02
  • 1
    @ekhumoro when i run `pip install pyqt6-qt6` i just recieve `ERROR: Could not find a version that satisfies the requirement PyQt6-Qt6 (from versions: none) ERROR: No matching distribution found for PyQt6-Qt6` – Harrison O'Donnell Jul 18 '22 at 21:35
  • @ekhumoro and when isntalling qt5 i recieve `Defaulting to user installation because normal site-packages is not writeable Collecting PyQt5 Using cached PyQt5-5.15.7.tar.gz (3.2 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 ╰─> [29 lines of output]` ive shortened the output if you need the rest just ask – Harrison O'Donnell Jul 18 '22 at 21:37
  • @HarrisonO'Donnell If you crop all the output, there no way to diagnose anything from it. Please don't dump stuff like this in comments - update your question instead. One other point: why are you using Python-3.9.2, rather than the latest version? What limits you to that version? Are you using something like Anaconda? – ekhumoro Jul 20 '22 at 10:32
  • @ekhumoro ah OK i'm sorry, i'm very new to this site.. when i update python it tells me 3.9.2 is the latest, so im not sure if there are any limits, this is my first device that even has access to linux commands so its all new to me, i just ran the first install of python, and then updated it, so if i do have python3.10 available i wouldnt know how to update too it. – Harrison O'Donnell Jul 21 '22 at 23:12
  • @HarrisonO'Donnell: I've run into the same PyQt6 issue with nanovnasaver compilation on Ubuntu 18.04.1 LTS, with pyenv managed Python versions 3.6.8, 3.72, 3.7.16 and 3.10.8. The issue is with qmake... not playing nice in the pyenv. I'll try find a solution and post an proper answer. Regarding the replies from users to your post, please don't give up on StackOverflow yet. It is not known for being friendly or nice. I still battle after years of friendly debugging on linuxforums.org, before it closed down. Good luck. – sarlacii Apr 03 '23 at 14:49

0 Answers0