pip install amuse-framework fails on Alma Linux 9 (CentOS)
I recently had to switch to an old laptop because of a hardware failure.
I tried reinstalling amuse on Alma Linux (formely CentOS, free equivalment of RHEL9), but I can't get around this error.
I am on Python 3.9.18. I also tried installing different versions of setuptools, to no avail.
Defaulting to user installation because normal site-packages is not writeable
Collecting amuse-framework
Using cached amuse_framework-2024.6.0.tar.gz (679 kB)
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
╰─> [82 lines of output]
WARNING setuptools_scm.pyproject_reading toml section missing 'pyproject.toml does not contain a tool.setuptools_scm section'
Traceback (most recent call last):
File "/tmp/pip-build-env-ics9_i8y/overlay/lib/python3.9/site-packages/setuptools_scm/_integration/pyproject_reading.py", line 36, in read_pyproject
section = defn.get("tool", {})[tool_name]
KeyError: 'setuptools_scm'
running dist_info
creating /tmp/pip-modern-metadata-koi7l6lp/amuse_framework.egg-info
writing /tmp/pip-modern-metadata-koi7l6lp/amuse_framework.egg-info/PKG-INFO
writing dependency_links to /tmp/pip-modern-metadata-koi7l6lp/amuse_framework.egg-info/dependency_links.txt
writing requirements to /tmp/pip-modern-metadata-koi7l6lp/amuse_framework.egg-info/requires.txt
writing top-level names to /tmp/pip-modern-metadata-koi7l6lp/amuse_framework.egg-info/top_level.txt
writing manifest file '/tmp/pip-modern-metadata-koi7l6lp/amuse_framework.egg-info/SOURCES.txt'
INFO: get_default_fcompiler: matching types: '['arm', 'gnu95', 'intel', 'lahey', 'pg', 'nv', 'absoft', 'nag', 'vast', 'compaq', 'intele', 'intelem', 'gnu', 'g95', 'pathf95', 'nagfor', 'fujitsu']'
Traceback (most recent call last):
File "/home/lex/.local/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
main()
File "/home/lex/.local/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/home/lex/.local/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 149, in prepare_metadata_for_build_wheel
return hook(metadata_directory, config_settings)
File "/tmp/pip-build-env-ics9_i8y/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 376, in prepare_metadata_for_build_wheel
self.run_setup()
File "/tmp/pip-build-env-ics9_i8y/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 521, in run_setup
super().run_setup(setup_script=setup_script)
File "/tmp/pip-build-env-ics9_i8y/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 319, in run_setup
exec(code, locals())
File "<string>", line 49, in <module>
File "/tmp/pip-build-env-ics9_i8y/overlay/lib/python3.9/site-packages/setuptools/__init__.py", line 117, in setup
return distutils.core.setup(**attrs)
File "/tmp/pip-build-env-ics9_i8y/overlay/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 183, in setup
return run_commands(dist)
File "/tmp/pip-build-env-ics9_i8y/overlay/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 199, in run_commands
dist.run_commands()
File "/tmp/pip-build-env-ics9_i8y/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 954, in run_commands
self.run_command(cmd)
File "/tmp/pip-build-env-ics9_i8y/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 999, in run_command
super().run_command(command)
File "/tmp/pip-build-env-ics9_i8y/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 973, in run_command
cmd_obj.run()
File "/tmp/pip-build-env-ics9_i8y/overlay/lib/python3.9/site-packages/setuptools/command/dist_info.py", line 93, in run
self.egg_info.run()
File "/tmp/pip-build-env-ics9_i8y/overlay/lib/python3.9/site-packages/setuptools/command/egg_info.py", line 312, in run
self.find_sources()
File "/tmp/pip-build-env-ics9_i8y/overlay/lib/python3.9/site-packages/setuptools/command/egg_info.py", line 320, in find_sources
mm.run()
File "/tmp/pip-build-env-ics9_i8y/overlay/lib/python3.9/site-packages/setuptools/command/egg_info.py", line 541, in run
self.add_defaults()
File "/tmp/pip-build-env-ics9_i8y/overlay/lib/python3.9/site-packages/setuptools/command/egg_info.py", line 579, in add_defaults
sdist.add_defaults(self)
File "/tmp/pip-build-env-ics9_i8y/overlay/lib/python3.9/site-packages/setuptools/command/sdist.py", line 110, in add_defaults
self._add_defaults_build_sub_commands()
File "/tmp/pip-build-env-ics9_i8y/overlay/lib/python3.9/site-packages/setuptools/command/sdist.py", line 130, in _add_defaults_build_sub_commands
self.filelist.extend(chain.from_iterable(files))
File "/tmp/pip-build-env-ics9_i8y/overlay/lib/python3.9/site-packages/setuptools/command/egg_info.py", line 484, in extend
self.files.extend(filter(self._safe_path, paths))
File "/tmp/pip-build-env-ics9_i8y/overlay/lib/python3.9/site-packages/setuptools/command/sdist.py", line 129, in <genexpr>
files = (c.get_source_files() for c in cmds if hasattr(c, "get_source_files"))
File "/tmp/pip-build-env-ics9_i8y/overlay/lib/python3.9/site-packages/setuptools/command/sdist.py", line 128, in <genexpr>
cmds = (self.get_finalized_command(c) for c in missing_cmds)
File "/tmp/pip-build-env-ics9_i8y/overlay/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 303, in get_finalized_command
cmd_obj.ensure_finalized()
File "/tmp/pip-build-env-ics9_i8y/overlay/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 111, in ensure_finalized
self.finalize_options()
File "/tmp/pip-install-_kwi4_ih/amuse-framework_e6190ba8b8794f429b6ee2adf4322878/support/setup_codes.py", line 814, in finalize_options
CodeCommand.finalize_options(self)
File "/tmp/pip-install-_kwi4_ih/amuse-framework_e6190ba8b8794f429b6ee2adf4322878/support/setup_codes.py", line 284, in finalize_options
self.set_fortran_variables()
File "/tmp/pip-install-_kwi4_ih/amuse-framework_e6190ba8b8794f429b6ee2adf4322878/support/setup_codes.py", line 360, in set_fortran_variables
compiler = fcompiler.new_fcompiler(requiref90=True)
File "/tmp/pip-build-env-ics9_i8y/overlay/lib64/python3.9/site-packages/numpy/distutils/fcompiler/__init__.py", line 892, in new_fcompiler
compiler = get_default_fcompiler(plat, requiref90=requiref90,
File "/tmp/pip-build-env-ics9_i8y/overlay/lib64/python3.9/site-packages/numpy/distutils/fcompiler/__init__.py", line 863, in get_default_fcompiler
compiler_type = _find_existing_fcompiler(matching_compiler_types,
File "/tmp/pip-build-env-ics9_i8y/overlay/lib64/python3.9/site-packages/numpy/distutils/fcompiler/__init__.py", line 807, in _find_existing_fcompiler
from numpy.distutils.core import get_distribution
File "/tmp/pip-build-env-ics9_i8y/overlay/lib64/python3.9/site-packages/numpy/distutils/core.py", line 24, in <module>
from numpy.distutils.command import config, config_compiler, \
File "/tmp/pip-build-env-ics9_i8y/overlay/lib64/python3.9/site-packages/numpy/distutils/command/config.py", line 19, in <module>
from numpy.distutils.mingw32ccompiler import generate_manifest
File "/tmp/pip-build-env-ics9_i8y/overlay/lib64/python3.9/site-packages/numpy/distutils/mingw32ccompiler.py", line 27, in <module>
from distutils.msvccompiler import get_build_version as get_build_msvc_version
ModuleNotFoundError: No module named 'distutils.msvccompiler'
[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.
Could you add which version of setuptools you are using?
Could you add which version of setuptools you are using?
setuptools.version '75.3.0'
Could you try installing an older setuptools (< 65)?
No luck with setuptools 64
lex@tpx1c:~/Work/tsunami/nospinbuild/python (master)$ pip install "setuptools<65"
Defaulting to user installation because normal site-packages is not writeable
Collecting setuptools<65
Using cached setuptools-64.0.3-py3-none-any.whl.metadata (6.2 kB)
Using cached setuptools-64.0.3-py3-none-any.whl (1.2 MB)
Installing collected packages: setuptools
Attempting uninstall: setuptools
Found existing installation: setuptools 75.3.0
Uninstalling setuptools-75.3.0:
Successfully uninstalled setuptools-75.3.0
Successfully installed setuptools-64.0.3
lex@tpx1c:~/Work/tsunami/nospinbuild/python (master)$ pip install amuse-framework
Defaulting to user installation because normal site-packages is not writeable
Collecting amuse-framework
Using cached amuse_framework-2024.6.0.tar.gz (679 kB)
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
╰─> [82 lines of output]
WARNING setuptools_scm.pyproject_reading toml section missing 'pyproject.toml does not contain a tool.setuptools_scm section'
Traceback (most recent call last):
File "/tmp/pip-build-env-faz87xem/overlay/lib/python3.9/site-packages/setuptools_scm/_integration/pyproject_reading.py", line 36, in read_pyproject
section = defn.get("tool", {})[tool_name]
KeyError: 'setuptools_scm'
running dist_info
creating /tmp/pip-modern-metadata-3uxm0oct/amuse_framework.egg-info
writing /tmp/pip-modern-metadata-3uxm0oct/amuse_framework.egg-info/PKG-INFO
writing dependency_links to /tmp/pip-modern-metadata-3uxm0oct/amuse_framework.egg-info/dependency_links.txt
writing requirements to /tmp/pip-modern-metadata-3uxm0oct/amuse_framework.egg-info/requires.txt
writing top-level names to /tmp/pip-modern-metadata-3uxm0oct/amuse_framework.egg-info/top_level.txt
writing manifest file '/tmp/pip-modern-metadata-3uxm0oct/amuse_framework.egg-info/SOURCES.txt'
INFO: get_default_fcompiler: matching types: '['arm', 'gnu95', 'intel', 'lahey', 'pg', 'nv', 'absoft', 'nag', 'vast', 'compaq', 'intele', 'intelem', 'gnu', 'g95', 'pathf95', 'nagfor', 'fujitsu']'
Traceback (most recent call last):
File "/home/lex/.local/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
main()
File "/home/lex/.local/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/home/lex/.local/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 149, in prepare_metadata_for_build_wheel
return hook(metadata_directory, config_settings)
File "/tmp/pip-build-env-faz87xem/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 376, in prepare_metadata_for_build_wheel
self.run_setup()
File "/tmp/pip-build-env-faz87xem/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 521, in run_setup
super().run_setup(setup_script=setup_script)
File "/tmp/pip-build-env-faz87xem/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 319, in run_setup
exec(code, locals())
File "<string>", line 49, in <module>
File "/tmp/pip-build-env-faz87xem/overlay/lib/python3.9/site-packages/setuptools/__init__.py", line 117, in setup
return distutils.core.setup(**attrs)
File "/tmp/pip-build-env-faz87xem/overlay/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 183, in setup
return run_commands(dist)
File "/tmp/pip-build-env-faz87xem/overlay/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 199, in run_commands
dist.run_commands()
File "/tmp/pip-build-env-faz87xem/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 954, in run_commands
self.run_command(cmd)
File "/tmp/pip-build-env-faz87xem/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 999, in run_command
super().run_command(command)
File "/tmp/pip-build-env-faz87xem/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 973, in run_command
cmd_obj.run()
File "/tmp/pip-build-env-faz87xem/overlay/lib/python3.9/site-packages/setuptools/command/dist_info.py", line 93, in run
self.egg_info.run()
File "/tmp/pip-build-env-faz87xem/overlay/lib/python3.9/site-packages/setuptools/command/egg_info.py", line 312, in run
self.find_sources()
File "/tmp/pip-build-env-faz87xem/overlay/lib/python3.9/site-packages/setuptools/command/egg_info.py", line 320, in find_sources
mm.run()
File "/tmp/pip-build-env-faz87xem/overlay/lib/python3.9/site-packages/setuptools/command/egg_info.py", line 541, in run
self.add_defaults()
File "/tmp/pip-build-env-faz87xem/overlay/lib/python3.9/site-packages/setuptools/command/egg_info.py", line 579, in add_defaults
sdist.add_defaults(self)
File "/tmp/pip-build-env-faz87xem/overlay/lib/python3.9/site-packages/setuptools/command/sdist.py", line 110, in add_defaults
self._add_defaults_build_sub_commands()
File "/tmp/pip-build-env-faz87xem/overlay/lib/python3.9/site-packages/setuptools/command/sdist.py", line 130, in _add_defaults_build_sub_commands
self.filelist.extend(chain.from_iterable(files))
File "/tmp/pip-build-env-faz87xem/overlay/lib/python3.9/site-packages/setuptools/command/egg_info.py", line 484, in extend
self.files.extend(filter(self._safe_path, paths))
File "/tmp/pip-build-env-faz87xem/overlay/lib/python3.9/site-packages/setuptools/command/sdist.py", line 129, in <genexpr>
files = (c.get_source_files() for c in cmds if hasattr(c, "get_source_files"))
File "/tmp/pip-build-env-faz87xem/overlay/lib/python3.9/site-packages/setuptools/command/sdist.py", line 128, in <genexpr>
cmds = (self.get_finalized_command(c) for c in missing_cmds)
File "/tmp/pip-build-env-faz87xem/overlay/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 303, in get_finalized_command
cmd_obj.ensure_finalized()
File "/tmp/pip-build-env-faz87xem/overlay/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 111, in ensure_finalized
self.finalize_options()
File "/tmp/pip-install-diwv_qvd/amuse-framework_adb4c22a479b4bc5a89fd7ae3cc057d1/support/setup_codes.py", line 814, in finalize_options
CodeCommand.finalize_options(self)
File "/tmp/pip-install-diwv_qvd/amuse-framework_adb4c22a479b4bc5a89fd7ae3cc057d1/support/setup_codes.py", line 284, in finalize_options
self.set_fortran_variables()
File "/tmp/pip-install-diwv_qvd/amuse-framework_adb4c22a479b4bc5a89fd7ae3cc057d1/support/setup_codes.py", line 360, in set_fortran_variables
compiler = fcompiler.new_fcompiler(requiref90=True)
File "/tmp/pip-build-env-faz87xem/overlay/lib64/python3.9/site-packages/numpy/distutils/fcompiler/__init__.py", line 892, in new_fcompiler
compiler = get_default_fcompiler(plat, requiref90=requiref90,
File "/tmp/pip-build-env-faz87xem/overlay/lib64/python3.9/site-packages/numpy/distutils/fcompiler/__init__.py", line 863, in get_default_fcompiler
compiler_type = _find_existing_fcompiler(matching_compiler_types,
File "/tmp/pip-build-env-faz87xem/overlay/lib64/python3.9/site-packages/numpy/distutils/fcompiler/__init__.py", line 807, in _find_existing_fcompiler
from numpy.distutils.core import get_distribution
File "/tmp/pip-build-env-faz87xem/overlay/lib64/python3.9/site-packages/numpy/distutils/core.py", line 24, in <module>
from numpy.distutils.command import config, config_compiler, \
File "/tmp/pip-build-env-faz87xem/overlay/lib64/python3.9/site-packages/numpy/distutils/command/config.py", line 19, in <module>
from numpy.distutils.mingw32ccompiler import generate_manifest
File "/tmp/pip-build-env-faz87xem/overlay/lib64/python3.9/site-packages/numpy/distutils/mingw32ccompiler.py", line 27, in <module>
from distutils.msvccompiler import get_build_version as get_build_msvc_version
ModuleNotFoundError: No module named 'distutils.msvccompiler'
[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.
I think you may need a newer version of NumPy here. At any rate, installing AMUSE via the instructions on the website is unfortunately broken. We're working on a brand new installer that doesn't use distutils or any of the other old Python packaging stuff, but it's not quite there yet.
I've recently made some alternative installation instructions for an AMUSE course in Leiden. Perhaps you could give them a try instead?
This has been obsoleted by the new build system, so I'm going to close it. If you run into any issues with that, please make a new issue.