pypa / setuptools

Official project repository for the Setuptools build system
https://pypi.org/project/setuptools/
MIT License
2.52k stars 1.19k forks source link

python12 ubutu 20.04 build horovod 0.28.1 #4655

Open jq opened 1 month ago

jq commented 1 month ago

setuptools version

setuptools==75.1.0

Python version

python 12

OS

ubuntu 20.04

Additional environment information

with python 12, tensorflow 2.16.2 ubuntu 20.04

Description

run HOROVOD_WITH_TENSORFLOW=1 \ HOROVOD_WITHOUT_PYTORCH=1 \ HOROVOD_WITHOUT_MXNET=1 \ HOROVOD_WITH_MPI=1 \ HOROVOD_WITHOUT_GLOO=1 \ python -m pip install --no-cache-dir horovod==0.28.1

How to Reproduce

run with python 12, tensorflow 2.16.2 ubuntu 20.04 HOROVOD_WITH_TENSORFLOW=1 \ HOROVOD_WITHOUT_PYTORCH=1 \ HOROVOD_WITHOUT_MXNET=1 \ HOROVOD_WITH_MPI=1 \ HOROVOD_WITHOUT_GLOO=1 \ python -m pip install --no-cache-dir horovod==0.28.1

Other detail

#26 0.594   Downloading horovod-0.28.1.tar.gz (3.5 MB)
#26 0.635      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.5/3.5 MB 155.6 MB/s eta 0:00:00
#26 1.725   Preparing metadata (setup.py): started
#26 1.767   Preparing metadata (setup.py): finished with status 'error'
#26 1.771   error: subprocess-exited-with-error
#26 1.771   
#26 1.771   × python setup.py egg_info did not run successfully.
#26 1.771   │ exit code: 1
#26 1.771   ╰─> [3 lines of output]
#26 1.771       /usr/local/lib/python3.12/site-packages/_distutils_hack/__init__.py:54: UserWarning: Reliance on distutils from stdlib is deprecated. Users must rely on setuptools to provide the distutils module. Avoid importing distutils or import setuptools first, and avoid setting SETUPTOOLS_USE_DISTUTILS=stdlib. Register concerns at https://github.com/pypa/setuptools/issues/new?template=distutils-deprecation.yml
#26 1.771         warnings.warn(
#26 1.771       ERROR: Can not execute `setup.py` since setuptools is not available in the build environment.
#26 1.771       [end of output]
abravalheri commented 1 month ago

It seems that setuptools is not installed or maybe your environment is broken because some files are present and others are not.

Please try the following:

  1. Uninstalling setuptools
  2. Make sure the file usr/local/lib/python3.12/site-packages/_distutils_hack/__init__.py was removed and no longer exists
  3. Make sure setuptools does not show up when you run pip list
  4. Make sure you cannot import _distutils_hack from the Python REPL
  5. Reinstall setuptools
  6. Make sure to follow any additional preparatory steps or th package you are trying to install.

The try installing the package with pip install --no-use-pep517 ...