Ask Your Question
1

error while trying to import weave

asked 2010-08-23 16:19:45 +0100

ngativ gravatar image

When trying to load the converter form weave i got the following error:

sage: from scipy import weave            
sage: from weave import converters       
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)

/home/alex/<ipython console> in <module>()

/opt/sage-4.5.2-linux-32bit-ubuntu_10.04_lts-i686-Linux/local/lib/python2.6/site-packages/weave/__init__.py in <module>()
     18 except:
     19     pass
     20 
---> 21 from numpy.testing import ScipyTest
     22 test = ScipyTest().test

ImportError: cannot import name ScipyTest

And ...

sage: import weave                       
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)

/home/alex/<ipython console> in <module>()

/opt/sage-4.5.2-linux-32bit-ubuntu_10.04_lts-i686-Linux/local/lib/python2.6/site-packages/weave/__init__.py in <module>()
     18 except:
     19     pass
     20 
---> 21 from numpy.testing import ScipyTest
     22 test = ScipyTest().test

ImportError: cannot import name ScipyTest

What can i do?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2010-08-23 20:28:19 +0100

Mike Hansen gravatar image

The following should work:

sage: from scipy.weave import converters

Note that this is different from

sage: from scipy import weave
sage: from weave import converters

which gives the ImportError. The weave in from weave import converters does not refer to the module imported in from scipy import weave. Look at the following example:

sage: import scipy.weave as w2
sage: from w2 import converters
Traceback (most recent call last)
...
ImportError: No module named w2
edit flag offensive delete link more

Comments

Thanks, should the documentation be fixed? http://www.sagemath.org/doc/numerical_sage/weave.html

ngativ gravatar imagengativ ( 2010-08-23 22:25:54 +0100 )edit
Mike Hansen gravatar imageMike Hansen ( 2010-08-23 22:39:00 +0100 )edit

I fixed the docu, so the ticket would need review. (and sorry for the duplicate, today is truly not my day...)

maldun gravatar imagemaldun ( 2011-01-25 10:30:49 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2010-08-23 16:19:45 +0100

Seen: 1,919 times

Last updated: Aug 23 '10