Skip to content

BUG: numpy distutils fails with setuptools 65.6.0 #22623

Description

@2sn

Describe the issue:

It tries to import Log from distutils.log but that has been removed in Version 65.6.0 of distutils.

Reproduce the code example:

pip3 install starfit

Error message:

SETUPTOOLS_ENABLE_FEATURES="legacy-editable" pip3 install -e .[testing]
Obtaining file:///home/alex/python/starfit
  Installing build dependencies ... done
  Checking if build backend supports build_editable ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [21 lines of output]
      Traceback (most recent call last):
        File "/home/alex/Python/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 351, in <module>
          main()
        File "/home/alex/Python/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 333, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/home/alex/Python/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
        File "/tmp/pip-build-env-jgu3of18/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 338, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
        File "/tmp/pip-build-env-jgu3of18/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 320, in _get_build_requires
          self.run_setup()
        File "/tmp/pip-build-env-jgu3of18/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 335, in run_setup
          exec(code, locals())
        File "<string>", line 3, in <module>
        File "/tmp/pip-build-env-jgu3of18/overlay/lib/python3.10/site-packages/numpy/distutils/__init__.py", line 26, in <module>
          from . import ccompiler
        File "/tmp/pip-build-env-jgu3of18/overlay/lib/python3.10/site-packages/numpy/distutils/ccompiler.py", line 20, in <module>
          from numpy.distutils import log
        File "/tmp/pip-build-env-jgu3of18/overlay/lib/python3.10/site-packages/numpy/distutils/log.py", line 4, in <module>
          from distutils.log import Log as old_Log
      ImportError: cannot import name 'Log' from 'distutils.log' (/tmp/pip-build-env-jgu3of18/overlay/lib/python3.10/site-packages/setuptools/_distutils/log.py)
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel 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.
make: *** [Makefile:6: install] Error 1

NumPy/Python version information:

1.23.4 3.10.7 (main, Sep 16 2022, 22:25:06) [GCC 12.2.1 20220819 (Red Hat 12.2.1-1)]

Context for the issue:

I assume basically no package that uses numpy.distutils can be installed from source.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions