0

I have an M1 Mac, I am using a Jupyter Notebook which is running pip 21.2.4 and python 3.8. I cannot install pyqt5. I have tried all of stackoverflow's existing solutions but none of them work.

What can I do to fix this? I have tried using pip version 22. Here is the error I am recieving:

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
  ╰─> [23 lines of output]
      Querying qmake about your Qt installation...
      Traceback (most recent call last):
        File "/Users/myname/Documents/Personal /Projects/TF Obj Detection/TFODCourse/tfod/lib/python3.8/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 "/Users/myname/Documents/Personal /Projects/TF Obj Detection/TFODCourse/tfod/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
      main()
    File "/Users/myname/Documents/Personal /Projects/TF Obj Detection/TFODCourse/tfod/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "/Users/myname/Documents/Personal /Projects/TF Obj Detection/TFODCourse/tfod/lib/python3.8/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 "/private/var/folders/3k/qr4ld40x2cjb_dw7gc9ldq380000gp/T/pip-build-env-el6agxiu/overlay/lib/python3.8/site-packages/sipbuild/api.py", line 46, in build_wheel
      project = AbstractProject.bootstrap('wheel',
    File "/private/var/folders/3k/qr4ld40x2cjb_dw7gc9ldq380000gp/T/pip-build-env-el6agxiu/overlay/lib/python3.8/site-packages/sipbuild/abstract_project.py", line 87, in bootstrap
      project.setup(pyproject, tool, tool_description)
    File "/private/var/folders/3k/qr4ld40x2cjb_dw7gc9ldq380000gp/T/pip-build-env-el6agxiu/overlay/lib/python3.8/site-packages/sipbuild/project.py", line 600, in setup
      self.update(tool)
    File "project.py", line 166, in update
  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.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
ba_
  • 15
  • 2
  • 8
  • 1
    https://stackoverflow.com/q/65447314/7976758 Found in https://stackoverflow.com/search?q=%5Bpyqt5%5D+AttributeError%3A+module+sipbuild.api+has+no+attribute+prepare_metadata_for_build_wheel – phd Jul 26 '22 at 14:20
  • What command you run to install pyqt? And why on jupyter notebooks? – ניר Jul 26 '22 at 14:25
  • I am following this course (https://www.youtube.com/watch?v=yqkISICHH-U) which is why I am using Jupyter Notebooks. Commands I have tried: pip install pyqt5 (error above) brew install pyqt5 (works but it still doesn't let me download labelimg which is the package i am trying to get to) @ניר – ba_ Jul 27 '22 at 06:52

0 Answers0