ImportError: unable to import linsolve name

I am testing a piece of Python code that contains a string:

from scipy import sparse, linsolve

When I run the script, I get an 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 part of scilab - or do I need to download linsolve.py separately?

+5
source share
1 answer

If this code is really trying to import scipy.linsolve, it was deprecated a long time ago and may have been removed from the latest versions of scipy. For compatibility, you can try the following:

from scipy import sparse
import scipy.sparse.linalg.dsolve as linsolve

sparse linsolve, - (, , - linsolve, , ).

+8

All Articles