Issues with pip installing PyQt5 in conda on M2 MacBook

146 views Asked by At

I am currently trying to use pip to install a package, but it stops when installing PyQt5. I am using an Anaconda Navigator environment per the installer's instructions (https://www.sams-xrays.com/install-smak).

  1. Install Anaconda Navigator from the website

  2. Create a new environment

    conda create -n smakenv python==3.10
    
  3. Activate new environment

    conda activate smakenv
    
  4. install program

    conda activate smakenv
    

This installation stalls when trying to install PyQt5 with the error:

(smakenv) Mirandas-MBP-2:~ miranda$ pip install PyQt5
Collecting PyQt5
  Using cached PyQt5-5.15.10.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
  ╰─> [17 lines of output]
      Querying qmake about your Qt installation...
      Traceback (most recent call last):
        File "/Users/miranda/anaconda3/envs/smakenv/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/Users/miranda/anaconda3/envs/smakenv/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/Users/miranda/anaconda3/envs/smakenv/lib/python3.10/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)
        File "/private/var/folders/s6/00ws0jr51770fkljkphkmfc80000gn/T/pip-build-env-gt_l3opo/overlay/lib/python3.10/site-packages/sipbuild/api.py", line 46, in build_wheel
          project = AbstractProject.bootstrap('wheel',
        File "/private/var/folders/s6/00ws0jr51770fkljkphkmfc80000gn/T/pip-build-env-gt_l3opo/overlay/lib/python3.10/site-packages/sipbuild/abstract_project.py", line 87, in bootstrap
          project.setup(pyproject, tool, tool_description)
        File "/private/var/folders/s6/00ws0jr51770fkljkphkmfc80000gn/T/pip-build-env-gt_l3opo/overlay/lib/python3.10/site-packages/sipbuild/project.py", line 602, in setup
          self.update(tool)
        File "/private/var/folders/s6/00ws0jr51770fkljkphkmfc80000gn/T/pip-install-jcfb2swp/pyqt5_a3845a406fd041b68c46d756b6ce117d/project.py", line 165, in update
          raise UserException(
      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.

I have tried various things to get PyQt to install, none of which have worked:

  1. Home-brew: Could not successfully integrate this into the Anaconda virtual environment

  2. Rosetta terminal (How can I run pyqt5 on my Mac with M1chip (ppc64el architecture)?) - this successfully downloaded PyQt5, but I could not successfully run the software (GUI did not show up) even when running python v3.10 as specified when setting up the Anaconda virtual environment.

I have a Macbook M2, running Monterey 12.5 and I am using Anaconda Navigator v2.5. The virtual environment has installed pip v23.3.

Thank you for your help!!

0

There are 0 answers