Installation problem of astropy via pip3

I tried to install astropy via pip3.
My environment is as follows:

  • MacBook Pro 14 inch
  • Apple M1 Max
  • macOS Monterey 12.6.1
  • Python3.10.8

When I typed “pip3 install astropy”, installation of pyerfa failed.
Though an installed version of pyerfa (0.0.0?) seems too old, I don’t know how to fix it.
I’m happy if anyone gives me feedback.

Using cached astropy-4.2.tar.gz (7.5 MB)
Installing build dependencies … error
error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> [75 lines of output]
Collecting setuptools
Using cached setuptools-65.6.3-py3-none-any.whl (1.2 MB)
Collecting setuptools_scm
Using cached setuptools_scm-7.0.5-py3-none-any.whl (42 kB)
Collecting wheel
Using cached wheel-0.38.4-py3-none-any.whl (36 kB)
Collecting cython==0.29.14
Using cached Cython-0.29.14.tar.gz (2.1 MB)
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status ‘error’
error: subprocess-exited-with-error

pip seems to have trouble handling pyerfa’s and astropy’s dependencies on setuptools_scm – if you first run pip3 install setuptools_scm, then the version numbers should be correctly resolved.
HTH

1 Like

After uninstalling all libraries installed using pip3 and reinstalling setuptools_scm first, I was able to install pyerfa and astropy.
Thank you very much!

1 Like