Ask Your Question
1

error while trying to import weave

asked 2010-08-23 09:19:45 -0500

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 13:28:19 -0500

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 15:25:54 -0500 )edit
Mike Hansen gravatar imageMike Hansen ( 2010-08-23 15:39:00 -0500 )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 03:30:49 -0500 )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 09:19:45 -0500

Seen: 1,124 times

Last updated: Aug 23 '10