I am testing a piece of Python code that contains the line:
from scipy import sparse, linsolve
When I run the script, I get the error:
from scipy import sparse, linsolve
ImportError: cannot import name linsolve
A quick google search shows the code for linsolve.py (hosted on Koders.com). My question is:
Is linsolve a part of scilab - or do I need to download linsolve.py separately?
If the code in question is actually trying to import scipy.linsolve
, that was deprecated a long time ago, and may well have been remove from the latest versions of scipy. For compatibility you could try this:
from scipy import sparse
import scipy.sparse.linalg.dsolve as linsolve
that should give the code the sparse
and linsolve
it relies on and shouldn't require any other modifications (unless there is something inside linsolve it relies on which has also changed, of course).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With