pertpy: Install fails on M1 macs

Describe the bug

Unable to install using pip on M1 mac (Tessa and @stefanpeidli) To Reproduce

mamba create -n pertpy_env python=3.9 conda activate pertpy_env pip install pertpy

(pertpy_env) stefanpeidli@Stefans-MBP ~ % pip install pertpy Collecting pertpy Using cached pertpy-0.3.0-py3-none-any.whl (82 kB) Collecting muon>=0.1.2 Using cached muon-0.1.2-py3-none-any.whl (287 kB) Collecting pypi-latest>=0.1.1 Using cached pypi_latest-0.1.2-py3-none-any.whl (10 kB) Collecting scipy<2.0.0,>=1.9.3 Downloading scipy-1.10.0-cp39-cp39-macosx_12_0_arm64.whl (28.9 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━28.9/28.9 MB 12.3 MB/s eta 0:00:00 Collecting PyYAML>=5.4.1 Downloading PyYAML-6.0-cp39-cp39-macosx_11_0_arm64.whl (173 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 174.0/174.0 kB 8.3 MB/s eta 0:00:00 Collecting arviz<0.15.0,>=0.14.0 Using cached arviz-0.14.0-py3-none-any.whl (1.7 MB) Collecting ipywidgets>=7.6.5 Downloading ipywidgets-8.0.4-py3-none-any.whl (137 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 137.8/137.8 kB 8.5 MB/s eta 0:00:00 Collecting scanpy>=1.8.1 Downloading scanpy-1.9.1-py3-none-any.whl (2.0 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.0/2.0 MB 12.1 MB/s eta 0:00:00 Collecting pyqt5<6.0.0,>=5.15.7 Using cached PyQt5-5.15.9.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] Traceback (most recent call last): File “/Users/stefanpeidli/miniconda3/envs/pertpy_env/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py”, line 144, 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/stefanpeidli/miniconda3/envs/pertpy_env/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 351, in <module>
      main()
    File "/Users/stefanpeidli/miniconda3/envs/pertpy_env/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 333, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "/Users/stefanpeidli/miniconda3/envs/pertpy_env/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 148, in prepare_metadata_for_build_wheel
      whl_basename = backend.build_wheel(metadata_directory, config_settings)
    File "/private/var/folders/fr/z238tpm931s466144gcdpdj40000gn/T/pip-build-env-hvo51gpt/overlay/lib/python3.9/site-packages/sipbuild/api.py", line 46, in build_wheel
      project = AbstractProject.bootstrap('wheel',
    File "/private/var/folders/fr/z238tpm931s466144gcdpdj40000gn/T/pip-build-env-hvo51gpt/overlay/lib/python3.9/site-packages/sipbuild/abstract_project.py", line 87, in bootstrap
      project.setup(pyproject, tool, tool_description)
    File "/private/var/folders/fr/z238tpm931s466144gcdpdj40000gn/T/pip-build-env-hvo51gpt/overlay/lib/python3.9/site-packages/sipbuild/project.py", line 585, in setup
      self.apply_user_defaults(tool)
    File "project.py", line 68, in apply_user_defaults
      super().apply_user_defaults(tool)
    File "/private/var/folders/fr/z238tpm931s466144gcdpdj40000gn/T/pip-build-env-hvo51gpt/overlay/lib/python3.9/site-packages/pyqtbuild/project.py", line 70, in apply_user_defaults
      super().apply_user_defaults(tool)
    File "/private/var/folders/fr/z238tpm931s466144gcdpdj40000gn/T/pip-build-env-hvo51gpt/overlay/lib/python3.9/site-packages/sipbuild/project.py", line 236, in apply_user_defaults
      self.builder.apply_user_defaults(tool)
    File "/private/var/folders/fr/z238tpm931s466144gcdpdj40000gn/T/pip-build-env-hvo51gpt/overlay/lib/python3.9/site-packages/pyqtbuild/builder.py", line 69, 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.`

Expected behavior

Installs and loads

System [please complete the following information]:

  • OS: Mac OS Ventura 13.01 [Tessa had the same problem in 13.02]
  • Language Version: Python 3.9 [Tessa had same in python 3.10]
  • Virtual environment: miniconda (stefan), miniforge (tessa)

Additional context

brew install of Qt5 seems like it might be necessary, but we’re still having trouble with it freezing on the license step for pyqt5 install even after that

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 1
  • Comments: 29 (19 by maintainers)

Most upvoted comments

@Moomboh thank you very much for your in depth response.

Yes, please open a separate issue for this. I’d also be happy to get a PR in with your suggested improvement and we can discuss it directly there!

It’s only required for the summary_prepare function which is also used for set_fdr. There’s probably a way to make things less arviz dependent but I would need to spend some time on it which I currently don’t have.

@mschilli87

  1. This is fixed in a big doc refactor that I’ll probably merge today. It’s pyqt6 and ete4 now.
  2. Yes, I think this makes sense. I’ll have a look later.

While I think it’s easier if I tackle this one, generally PRs are very welcome.

Prior to installing pertpy, install Qt5 via brew (and follow the directions to add to path), restart terminal, then run: pip install pyqt5 --config-settings --confirm-license= --verbose

Then pip install pertpy works