New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Import error with latest version of scipy installed #2158
Comments
@ehtec Thanks for reporting this! I was able to replicate the issue and found the following:
import cvxpy as cp
import numpy as np
import scipy.sparse as sp
a = cp.Variable((1,3))
b = sp.coo_matrix(np.arange(3))
a + b
>>> Expression(AFFINE, UNKNOWN, (1, 3))
b + a
>>> Expression(AFFINE, UNKNOWN, (1, 3))
a.__add__(b)
>>> Expression(AFFINE, UNKNOWN, (1, 3))
b.__add__(a)
>>> NotImplemented My thoughts are:
The files have been there for quite a long time, so maybe @cvxpy/maintainers can give some context. |
I can confirm we are experiencing the same issue since a few hours ago |
Hi all, we're also experiencing the same issues on our end! Will keep an eye on this thread :) |
I can confirm we are facing the same issue here |
Thanks, everyone for the heads-ups! It looks like everyone who is installing |
There are changes in API I have a sense that it is not going to be one line fix. |
Linking @h-vetinari's PR in the SciPy repo: scipy/scipy#18749 |
The proposal here seems fine to me: The purpose of scipy_wrapper.py is to enable operator overloading with SciPy sparse matrices. It's not needed for NumPy ndarrays because NumPy has better native support for operator overloading. |
I started a PR to fix this: |
Closed via #2159, patch is in the works. |
When will this fix be released to pypi? |
The patch is now available on PyPI: https://pypi.org/project/cvxpy/1.3.2/ |
Much appreciated, thanks |
See this link for details on the previous problem: cvxpy/cvxpy#2158
Describe the bug
When using this together with the latest version 1.11.0 of scipy (from pypi), you get an error when importing cvxpy:
Version
Additional context
I encountered this because my CI pipeline is failing since the latest version of scipy was released a few hours ago. It works with scipy 1.10.1 (the second-latest version).
The text was updated successfully, but these errors were encountered: