pyinterval icon indicating copy to clipboard operation
pyinterval copied to clipboard

Installation fails with setuptools>=75.0.0

Open Schmaexxi opened this issue 1 year ago • 3 comments

Hi! Even though this repo doesn't seem active any more, I'll put this out here in case anyone else has an issue installing this package.

Problem description

Cannot install pyinterval with setuptools>=75.0.0 due to major changes in setuptools. Crlibm, which is a direct dependency of pyinterval fails to install due to the changes in setuptools (specific error below)

My speccs

  • Apple M1 Max
  • 32GB memory

Tested with: Python 3.10, 3.11

The same error occurs in a Github runner on Ubuntu 22.04.5 LTS with Python 3.10

Installation failure shell output

pip install --no-cache pyinterval                                                                                                                                                                        ml/aint/ci [6c4db28870]
Looking in indexes: https://pypi.org/simple
Collecting pyinterval
  Downloading pyinterval-1.2.0.tar.gz (25 kB)
  Preparing metadata (setup.py) ... done
Collecting crlibm==1.*,>=1.0.3 (from pyinterval)
  Downloading crlibm-1.0.3.tar.gz (1.6 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.6/1.6 MB 1.4 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [6 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/private/var/folders/km/d_mh08b54j52lf5b16g476k40000gn/T/pip-install-9drerz7x/crlibm_43dfd5bfd6bb44ed8de5cfd7748b06ef/setup.py", line 15, in <module>
          from distutils.command.upload import upload
      ModuleNotFoundError: No module named 'distutils.command.upload'
      [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.

Looking at crlibm's setup.py, it shows the failing import. I haven't looked into why setuptools removed this but it definitely makes this part fail. Their changelog states the removal in v75.0.0, which refers to this commit

Workaround

Use setuptools<=74.1.3

Schmaexxi avatar Oct 01 '24 21:10 Schmaexxi

Thanks!

Iaotle avatar Oct 24 '24 21:10 Iaotle

I'm using setuptools==74.1.3 with python 3.11.4 and still running into the same issue.

$ pip install --no-cache pyinterval
Collecting pyinterval
  Downloading pyinterval-1.2.0.tar.gz (25 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting crlibm==1.*,>=1.0.3 (from pyinterval)
  Downloading crlibm-1.0.3.tar.gz (1.6 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.6/1.6 MB 45.9 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [20 lines of output]
      Traceback (most recent call last):
File "/Users/myuser/.pyenv/versions/3.11.4/envs/venv3114/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/Users/myuser/.pyenv/versions/3.11.4/envs/venv3114/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/Users/myuser/.pyenv/versions/3.11.4/envs/venv3114/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/vt/2r91wcsj4s9dg7cd0y9tqrkr0000gn/T/pip-build-env-6x6k1js2/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 333, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=[])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/vt/2r91wcsj4s9dg7cd0y9tqrkr0000gn/T/pip-build-env-6x6k1js2/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 303, in _get_build_requires
          self.run_setup()
        File "/private/var/folders/vt/2r91wcsj4s9dg7cd0y9tqrkr0000gn/T/pip-build-env-6x6k1js2/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 521, in run_setup
          super().run_setup(setup_script=setup_script)
        File "/private/var/folders/vt/2r91wcsj4s9dg7cd0y9tqrkr0000gn/T/pip-build-env-6x6k1js2/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 319, in run_setup
          exec(code, locals())
        File "<string>", line 15, in <module>
      ModuleNotFoundError: No module named 'distutils.command.upload'
      [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.

UPDATE pip install --upgrade wheel resolved the issue.

rubnov avatar Nov 04 '24 12:11 rubnov

The wheel update didn't fix it for me on M3 mac

nachiket avatar Feb 12 '25 15:02 nachiket