Cannot install gappy on a MacBook with M1 Pro chip

112 Views Asked by At

I tried to install gappy package for Python using Anaconda, following the instructions given here: https://pypi.org/project/gappy-system/. However, every time after using pip install gappy-system I got the following output:

(gap) igorsikora@laptop-Igor ~ % pip install gappy-system
Collecting gappy-system
  Using cached gappy-system-0.1.0a3.tar.gz (119 kB)
  Installing build dependencies ... error
  error: subprocess-exited-with-error
  
  × pip subprocess to install build dependencies did not run successfully.
  │ exit code: 1
  ╰─> [98 lines of output]
      Collecting Cython<3.0.0
        Using cached Cython-0.29.35-py2.py3-none-any.whl (988 kB)
      Collecting cysignals
        Using cached cysignals-1.11.2.tar.gz (99 kB)
        Preparing metadata (setup.py): started
        Preparing metadata (setup.py): finished with status 'done'
      Collecting setuptools>=42
        Using cached setuptools-68.0.0-py3-none-any.whl (804 kB)
      Collecting setuptools_scm[toml]>=3.4
        Using cached setuptools_scm-7.1.0-py3-none-any.whl (43 kB)
      Collecting wheel
        Using cached wheel-0.40.0-py3-none-any.whl (64 kB)
      Collecting packaging>=20.0 (from setuptools_scm[toml]>=3.4)
        Using cached packaging-23.1-py3-none-any.whl (48 kB)
      Collecting typing-extensions (from setuptools_scm[toml]>=3.4)
        Using cached typing_extensions-4.6.3-py3-none-any.whl (31 kB)
      Collecting tomli>=1.0.0 (from setuptools_scm[toml]>=3.4)
        Using cached tomli-2.0.1-py3-none-any.whl (12 kB)
      Building wheels for collected packages: cysignals
        Building wheel for cysignals (setup.py): started
        Building wheel for cysignals (setup.py): finished with status 'error'
        error: subprocess-exited-with-error
      
        × python setup.py bdist_wheel did not run successfully.
        │ exit code: 1
        ╰─> [65 lines of output]
            /Users/igorsikora/anaconda3/envs/gap/lib/python3.10/site-packages/pkg_resources/__init__.py:121: DeprecationWarning: pkg_resources is deprecated as an API
              warnings.warn("pkg_resources is deprecated as an API", DeprecationWarning)
            /Users/igorsikora/anaconda3/envs/gap/lib/python3.10/site-packages/setuptools/__init__.py:84: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated.
            !!
      
                    ********************************************************************************
                    Requirements should be satisfied by a PEP 517 installer.
                    If you are using pip, you can try `pip install --use-pep517`.
                    ********************************************************************************
      
            !!
              dist.fetch_build_eggs(dist.setup_requires)
            running bdist_wheel
            running build
            running build_py
            running configure
            autoconf
            make: autoconf: No such file or directory
            make: *** [configure] Error 1
            Traceback (most recent call last):
              File "<string>", line 2, in <module>
              File "<pip-setuptools-caller>", line 34, in <module>
              File "/private/var/folders/nj/9_mvjxvn0r31hxxb4gnp12d00000gn/T/pip-install-2yu5i3w0/cysignals_8ff2ef36b17646ceae2c6ed6ed36aa72/setup.py", line 193, in <module>
                setup(
              File "/Users/igorsikora/anaconda3/envs/gap/lib/python3.10/site-packages/setuptools/__init__.py", line 107, in setup
                return distutils.core.setup(**attrs)
              File "/Users/igorsikora/anaconda3/envs/gap/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 185, in setup
                return run_commands(dist)
              File "/Users/igorsikora/anaconda3/envs/gap/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
                dist.run_commands()
              File "/Users/igorsikora/anaconda3/envs/gap/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
                self.run_command(cmd)
              File "/Users/igorsikora/anaconda3/envs/gap/lib/python3.10/site-packages/setuptools/dist.py", line 1244, in run_command
                super().run_command(command)
              File "/Users/igorsikora/anaconda3/envs/gap/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
                cmd_obj.run()
              File "/Users/igorsikora/anaconda3/envs/gap/lib/python3.10/site-packages/wheel/bdist_wheel.py", line 343, in run
                self.run_command("build")
              File "/Users/igorsikora/anaconda3/envs/gap/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
                self.distribution.run_command(command)
              File "/Users/igorsikora/anaconda3/envs/gap/lib/python3.10/site-packages/setuptools/dist.py", line 1244, in run_command
                super().run_command(command)
              File "/Users/igorsikora/anaconda3/envs/gap/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
                cmd_obj.run()
              File "/Users/igorsikora/anaconda3/envs/gap/lib/python3.10/site-packages/setuptools/_distutils/command/build.py", line 131, in run
                self.run_command(cmd_name)
              File "/Users/igorsikora/anaconda3/envs/gap/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
                self.distribution.run_command(command)
              File "/Users/igorsikora/anaconda3/envs/gap/lib/python3.10/site-packages/setuptools/dist.py", line 1244, in run_command
                super().run_command(command)
              File "/Users/igorsikora/anaconda3/envs/gap/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
                cmd_obj.run()
              File "/private/var/folders/nj/9_mvjxvn0r31hxxb4gnp12d00000gn/T/pip-install-2yu5i3w0/cysignals_8ff2ef36b17646ceae2c6ed6ed36aa72/setup.py", line 172, in run
                self.run_command('configure')
              File "/Users/igorsikora/anaconda3/envs/gap/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
                self.distribution.run_command(command)
              File "/Users/igorsikora/anaconda3/envs/gap/lib/python3.10/site-packages/setuptools/dist.py", line 1244, in run_command
                super().run_command(command)
              File "/Users/igorsikora/anaconda3/envs/gap/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
                cmd_obj.run()
              File "/private/var/folders/nj/9_mvjxvn0r31hxxb4gnp12d00000gn/T/pip-install-2yu5i3w0/cysignals_8ff2ef36b17646ceae2c6ed6ed36aa72/setup.py", line 133, in run
                subprocess.check_call(['make', 'configure'])
              File "/Users/igorsikora/anaconda3/envs/gap/lib/python3.10/subprocess.py", line 369, in check_call
                raise CalledProcessError(retcode, cmd)
            subprocess.CalledProcessError: Command '['make', 'configure']' returned non-zero exit status 2.
            [end of output]
      
        note: This error originates from a subprocess, and is likely not a problem with pip.
        ERROR: Failed building wheel for cysignals
        Running setup.py clean for cysignals
      Failed to build cysignals
      ERROR: Could not build wheels for cysignals, which is required to install pyproject.toml-based projects
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

I tried to focus on ERROR: Could not build wheels for cysignals, which is required to install pyproject.toml-based projects, so I installed Cython and cysignals. However, this did not help, the error output remains the same.

My system is MacBook Pro with M1 Pro chip and macOS Ventura 13.4 Any help will be appreciated!

EDIT: I used the following chain of commands:

conda create -n gap
conda activate gap
conda install -c conda-forge gap-defaults==4.11 python==3.10
pip install gappy-system
1

There are 1 best solutions below

0
merv On

This works for me:

so-gappy.yaml

name: so-gappy
channels:
  - conda-forge
  - nodefaults
dependencies:
  ## Python Core
  - python=3.10
  - pip

  ## compiler tools
  - autoconf
  - c-compiler
  - cython

  ## gappy deps
  - gap-defaults=4.11
  - cysignals
  - psutil

  ## PyPI pkgs
  - pip:
    - gappy-system

then

mamba env create -n so-gappy -f so-gappy.yaml

The immediate error in OP is from lack of autoconf, but setting gap-defaults=4.11 appears necessary, as specified in the repository documentation. The other stuff helps ensure only the gappy-system package is what has to come from PyPI, and all the other infrastructure is available. I tried python=3.9 and python=3.10 - both worked on osx-arm64 platform.