Package no longer installable from pip
envgap__cvxpy__cvxpy-1950
01 / FAILURE SIGNATURE
As reported upstream
ImportError: cannot import name 'Log' from 'distutils.log' (/private/var/folders/pm/97sf8nsj4vz8kvg14d9ymn3r0000gn/T/pip-build-env-kgudujw0/overlay/lib/python3.10/site-packages/setuptools/_distutils/log.py)
Not a benchmark task.
- The project already builds and runs before the fix, so there is nothing to repair.
02 / ENVIRONMENT RECIPE
- Base commit
475c2d4394ea8ea04c8beb1dc2442a7682819203- Manifest
pyproject.toml- Reproduce
Awaiting issue-specific recipe- Run under trace
Awaiting a meaningful runtime command
03 / ORIGINAL ISSUE TEXT
cvxpy/cvxpy #1950 · read the original issue
**Describe the bug**
cvxpy fails to build when running `pip install cvxpy` on a platform that doesn't supply binaries for the scs dependency.
**To Reproduce**
On an arm mac (M1/M2) in a fresh virtual environment run `pip install cvxpy`
**Expected behavior**
Pip is expected to either download or build the dependencies.
**Output**
We're greeted with
```
Processing /Users/user/dependencies/cvxpy
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
....
Collecting scs>=1.1.6
Using cached scs-3.2.2.tar.gz (663 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
╰─> [62 lines of output]
....
from numpy.distutils import log
File "/private/var/folders/pm/97sf8nsj4vz8kvg14d9ymn3r0000gn/T/pip-build-env-kgudujw0/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' (/private/var/folders/pm/97sf8nsj4vz8kvg14d9ymn3r0000gn/T/pip-build-env-kgudujw0/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: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
```
**Version**
- OS: macOS Ventura
- CVXPY Version: 1.2.2
**Additional context**
The `pip install` approach worked on Friday and was broken due to this https://github.com/pypa/setuptools/issues/3693 issue.
A possible solution would be to pin the setuptools version to <60 per [this comment](https://github.com/numpy/numpy/issues/22623#issuecomment-1321012633)
04 / LABELS
Labels from the report text only; not yet run
No supported category has been assigned.
Label rules and the text that matched
[]