I am getting a import error?

asked 2013-04-28 08:41:03 +0100

naren gravatar image

updated 2013-04-30 05:13:22 +0100

vdelecroix gravatar image

I have recently shifted to python from Matlab. I have tried installing a toolbox SPAMS(sparse modelling software) using sage --python. When I try to import spams module it gives

>>> import spams
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-2eecc34cc6d3> in <module>()
----> 1 import spams

/opt/spams-python/spams.py in <module>()
      5 
----> 6 import spams_wrap
      7 import numpy as np

/opt/spams-python/spams_wrap.py in <module>()
     30             return _mod
---> 31     _spams_wrap = swig_import_helper()
     32     del swig_import_helper

/opt/spams-python/spams_wrap.py in swig_import_helper()
     22         except ImportError:
---> 23             import _spams_wrap
     24             return _spams_wrap

ImportError: /opt/sage-5.9.beta5/local/lib/liblapack.so: undefined symbol: cblas_zswap

I know ATLAS, LAPACK and BLAS are already present in the stage installation.

Kindly help me resolve this issue. Any help will be appreciated.

Cheers, Naren

edit retag flag offensive close merge delete

Comments

Did you follow the installation instructions for SPAMS as in section 2 of [the SPAMS documentation](http://spams-devel.gforge.inria.fr/doc-python/doc_spams.pdf), but replacing python setup.py install --prefix=your-installation-dir by sage --python setup.py install --prefix=your-installation-dir ?

slelievre gravatar imageslelievre ( 2013-04-28 09:03:25 +0100 )edit

Yeah I did. I have replaced "python" by "sage --python"

naren gravatar imagenaren ( 2013-04-29 08:56:04 +0100 )edit

Yeah I did. I have replaced "python" by "sage --python" It didn't show any error when I installed it but it reported the ImportError when tried "import spams" in sage notebook.

naren gravatar imagenaren ( 2013-04-29 08:56:04 +0100 )edit

Can anyone please help me with this problem!

naren gravatar imagenaren ( 2013-04-30 03:09:23 +0100 )edit

Hi, I edited your post with the (almost) complete Traceback that I was able to reproduce on my computer. The error is quite strange. You perhpas would ask your question on sage-support (https://groups.google.com/group/sage-support) with a link to this post.

vdelecroix gravatar imagevdelecroix ( 2013-04-30 05:17:51 +0100 )edit