cvxpy: `cvxpy` fails to install on Python 3.12
Describe the bug
Running pip install cvxpy fails when using Python 3.12
To Reproduce
conda create -n py312-cvxpy python=3.12
conda activate py312-cvxpy
pip install cvxpy
Output
Version
- OS: macOS
- CVXPY Version: latest
Additional context
- I checked and it works fine using Python 3.11
- I’m using an M1 mac.
About this issue
- Original URL
- State: closed
- Created 8 months ago
- Comments: 23 (5 by maintainers)
I think that leaves qdldl as the only dependency without wheels for Python 3.12. I think it might have less demanding build time dependencies so maybe it is easy to
pip install cvxpyon 3.12 now. Still I opened a PR to help enable wheel builds for 3.12 for qdldl here: https://github.com/osqp/qdldl-python/pull/37.Thanks @RoyiAvital. So scs is okay now, but qdldl (dependency of osqp which is a dependency of cvxpy) still has no wheel for Python 3.12. So the next step would be to ask if wheels for 3.12 could be added at https://github.com/osqp/qdldl-python. There is a conda-forge package for qdldl for Python 3.12 so it should be compatible.
(Alternatively you could try to set up the build system to build from source by installing cmake).
qdldl wheels are up.
We just released a patch that includes wheels for 3.12: https://pypi.org/project/cvxpy/1.4.3/
Feel free to reopen if there are any remaining issues that we should take a look at with 3.12.
if you are in a hurry, you can grab the .whl from here (minus one patch in waiting) https://github.com/cvxpy/cvxpy/actions/runs/8604826651/job/23580091820
@phschiele I noticed that you commented here that cvxpy will release this month with wheels for Python 3.12. I was curious if there was any overlap between the cvxpy and osqp teams to help get 3.12 wheels of qdldl released as well to allow installing cvxpy on 3.12 without building anything locally.
Having cvxpy-1.4.2 wheels on pypi for Python-3.12 would have been nice.
@enzbus https://github.com/conda-forge/scs-feedstock/pull/38 added scs 3.2.4 to conda-forge. 3.2.4 adds Python 3.12 support but it was not built in that PR. There is a follow up PR, https://github.com/conda-forge/scs-feedstock/pull/40, adding the 3.12 build. Still, the 3.12 build should be available from conda-forge in the next couple hours (once that PR finishes building and gets seeded to the CDN).
I could install cvxpy1.4.2 in Python 3.12 via
pip install cvxpy==1.4.2now (Windows 11). Thoughconda install -c conda-forge cvxpydidn’t work.