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:that should give the code the
sparseandlinsolveit relies on and shouldn’t require any other modifications (unless there is something inside linsolve it relies on which has also changed, of course).