Several packages failing on sparse/csgraph/_validation.py

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",
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: 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! Thanks, Deacon

On Thu, Dec 11, 2014 at 6:09 PM, Deacon Sweeney <dsweeney@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
participants (2)
-
Deacon Sweeney
-
Ralf Gommers