[SciPy-Dev] Several packages failing on sparse/csgraph/_validation.py

Ralf Gommers ralf.gommers at gmail.com
Sun Dec 14 09:20:16 EST 2014


On Thu, Dec 11, 2014 at 6:09 PM, Deacon Sweeney <dsweeney at scimentis.com>
wrote:
>
> Hello,
>
> I'm having an unusual bug on a fresh installation of scipy on SUSE, with
> Python 2.7.8. There are several packages (stats, sparse, optimize,
> interpolate, etc) that all fail to import due to
> sparse/csgraph/_validation.py. Here is the error message from sparse:
>
> >>> import scipy.sparse
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File
> "/itmi/Python-2.7.8_a/lib/python2.7/site-packages/scipy/sparse/__init__.py",
> line 206, in <module>
>     from scipy.sparse.csgraph import _validation
>   File
> "/itmi/Python-2.7.8_a/lib/python2.7/site-packages/scipy/sparse/csgraph/__init__.py",
> line 122, in <module>
>     from scipy.sparse.csgraph import _validation
>   File
> "/itmi/Python-2.7.8_a/lib/python2.7/site-packages/scipy/sparse/csgraph/_validation.py",
> line 4, in <module>
>     from scipy.sparse import csr_matrix, isspmatrix, isspmatrix_csc,
> isspmatrix_csr
> ImportError: cannot import name csr_matrix
>
> We have a bit of an unusual installation arrangement here, where I have to
> use the "module load" command to switch Python versions.
>
> I can't find anything searching around, so I figured I'd reach out to the
> experts here while digging in further myself. Any insights would be very
> appreciated!
>

It fails on an absolute import from scipy.sparse reached from within
scipy.sparse.__init__. Does it help to change line 4 of _validation.py to
``from .. import csr_matrix <etc>``?

I'm not sure what "module load" does exactly, is that something specific to
your setup?

Ralf
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20141214/ef7b87a1/attachment.html>


More information about the SciPy-Dev mailing list