mising numpy.testing.decorators

Bug #336356 reported by pieper
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
NIPY
New
Undecided
Unassigned

Bug Description

I tried a fresh install on mac (10.5).

I have python 2.5, numpy 1.2.1, scipy 0.7.0, and matplotlib 0.98.5.2 (binary downloads), and ipython 0.9.1 (source install), which all seem to work fine.

However when I try to build nipy, I get the error below.

I tried removing the testing code, but then got a message about missing scipy.weave.

No rush - I know the code's fresh - just wanted to be sure I wasn't off on the wrong track or missed something obvious.

#546 bash-Sun Mar 01, 02:13 PM ~/downloads/python/nipy/nipy
bzr update
Tree is up to date at revision 1725.
#547 bash-Sun Mar 01, 02:13 PM ~/downloads/python/nipy/nipy
python setup.py build_ext --inplace
Traceback (most recent call last):
  File "setup.py", line 4, in <module>
    from neuroimaging import packages, __version__, __doc__
  File "/Users/pieper/downloads/python/nipy/nipy/neuroimaging/__init__.py", line 76, in <module>
    from neuroimaging.testing import Tester
  File "/Users/pieper/downloads/python/nipy/nipy/neuroimaging/testing/__init__.py", line 33, in <module>
    import decorators as dec
  File "/Users/pieper/downloads/python/nipy/nipy/neuroimaging/testing/decorators.py", line 7, in <module>
    from numpy.testing.decorators import *
ImportError: No module named decorators

Revision history for this message
Christopher Burns (cburns) wrote : Re: [Bug 336356] [NEW] mising numpy.testing.decorators

That traceback says there is no decorators module in the numpy you
have installed. It's possible there's something wrong with your numpy
testing framework (which nipy uses).

I just installed the numpy binary from SourceForge:

numpy-1.2.1-py2.5-macosx10.5.dmg

And the testing decorators are there. Could you try running the numpy
tests in ipython and report back the result?

  import numpy as np
  np.test()

Thanks!
Chris

On Sun, Mar 1, 2009 at 11:20 AM, pieper <email address hidden> wrote:
> Public bug reported:
>
> I tried a fresh install on mac (10.5).
>
> I have python 2.5, numpy 1.2.1, scipy 0.7.0, and matplotlib 0.98.5.2
> (binary downloads), and ipython 0.9.1 (source install), which all seem
> to work fine.
>
> However when I try to build nipy, I get the error below.
>
> I tried removing the testing code, but then got a message about missing
> scipy.weave.
>
> No rush - I know the code's fresh - just wanted to be sure I wasn't off
> on the wrong track or missed something obvious.
>
>
> #546 bash-Sun Mar 01, 02:13 PM ~/downloads/python/nipy/nipy
> bzr update
> Tree is up to date at revision 1725.
> #547 bash-Sun Mar 01, 02:13 PM ~/downloads/python/nipy/nipy
> python setup.py build_ext --inplace
> Traceback (most recent call last):
>  File "setup.py", line 4, in <module>
>    from neuroimaging import packages, __version__, __doc__
>  File "/Users/pieper/downloads/python/nipy/nipy/neuroimaging/__init__.py", line 76, in <module>
>    from neuroimaging.testing import Tester
>  File "/Users/pieper/downloads/python/nipy/nipy/neuroimaging/testing/__init__.py", line 33, in <module>
>    import decorators as dec
>  File "/Users/pieper/downloads/python/nipy/nipy/neuroimaging/testing/decorators.py", line 7, in <module>
>    from numpy.testing.decorators import *
> ImportError: No module named decorators
>
> ** Affects: nipy
>     Importance: Undecided
>         Status: New

Revision history for this message
pieper (pieper) wrote :
Download full text (4.6 KiB)

Hi Chris -

That is strange - the test passes, but no decorators in my install
(output below). I am using the same 1.2.1 installer you mentioned and
in fact I just re-ran the installer, but I noticed I get the following
version number:

In [3]: numpy.version.version
Out[3]: '1.0.1'

any ideas?

Thanks!
-Steve

---- test result ---

Leopard libedit detected.
Python 2.5.1 (r251:54863, Jan 13 2009, 10:26:13)
Type "copyright", "credits" or "license" for more information.

IPython 0.9.1 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object'. ?object also works, ?? prints more.

In [1]: import numpy as np

In [2]: np.test()
   Found 13 tests for numpy.core.umath
   Found 9 tests for numpy.lib.arraysetops
   Found 4 tests for numpy.ctypeslib
   Found 2 tests for numpy.lib.polynomial
   Found 9 tests for numpy.core.records
   Found 29 tests for numpy.core.numeric
   Found 5 tests for numpy.distutils.misc_util
   Found 3 tests for numpy.lib.getlimits
   Found 31 tests for numpy.core.numerictypes
   Found 4 tests for numpy.core.scalarmath
   Found 12 tests for numpy.lib.twodim_base
   Found 1 tests for numpy.lib.ufunclike
   Found 4 tests for numpy.lib.index_tricks
   Found 32 tests for numpy.linalg.linalg
   Found 42 tests for numpy.lib.type_check
   Found 3 tests for numpy.fft.helper
   Found 1 tests for numpy.fft.fftpack
   Found 47 tests for numpy.lib.shape_base
   Found 188 tests for numpy.core.multiarray
   Found 36 tests for numpy.core.ma
   Found 10 tests for numpy.core.defmatrix
   Found 41 tests for numpy.lib.function_base
   Found 0 tests for __main__
..............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
----------------------------------------------------------------------
Ran 526 tests in 0.583s

OK
Out[2]: <unittest.TextTestRunner object at 0x180b9f0>

In [3]: from numpy.testing.decorators import *
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)

/Users/pieper/downloads/python/nipy/nipy/<ipython console> in <module>()

ImportError: No module named decorators

Christopher Burns wrote:
> That traceback says there is no decorators module in the numpy you
> have installed. It's possible there's something wrong with your numpy
> testing framework (which nipy uses).
>
> I just installed the numpy binary from SourceForge:
>
> numpy-1.2.1-py2.5-macosx10.5.dmg
>
> And the testing decorators are there. Could you try running the numpy
> tests in ipython and report back the result?
>
> import numpy as np
> np.test()
>
> Tha...

Read more...

Revision history for this message
Christopher Burns (cburns) wrote :

Hey Steve,

It's picking up the version of numpy that is bundled with Leopard.
The 1.2.1 installer is compatible with the MacPython version of python
which is available here:
http://www.python.org/download/mac/

From the output, it appears you are using the System Python:
Python 2.5.1 (r251:54863, Jan 13 2009, 10:26:13)

I expect you'd see this in a shell:
$ which python
/System/Library/Frameworks/Python.framework/Versions/Current/bin/python

And you want MacPython which would be here:
cburns@bin 12:22:54 $ which python
/Library/Frameworks/Python.framework/Versions/Current/bin/python

Leopard ships with Python and numpy 1.0, but it's recommended to
install MacPython if you plan to install newer versions of numpy (or
any package which may already be installed in the System Python).
This prevents one from braking anything the OS is using in it's
version of python and it's site-packages.

If you've already installed MacPython, then this may just be a PATH
issue. In which case, make sure MacPython is in your path and the
System Python is not.

Numpy's path:

With System Python:
>>> import numpy as np
>>> print np.__path__
['/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/numpy']
>>> np.__version__
'1.0.1'

With MacPython:
In [2]: np.__path__
Out[2]: ['/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/numpy']
In [3]: np.__version__
Out[3]: '1.2.1'

Chris

On Mon, Mar 2, 2009 at 12:02 PM, pieper <email address hidden> wrote:
> Hi Chris -
>
> That is strange - the test passes, but no decorators in my install
> (output below).  I am using the same 1.2.1 installer you mentioned and
> in fact I just re-ran the installer, but I noticed I get the following
> version number:
>
> In [3]: numpy.version.version
> Out[3]: '1.0.1'
>
> any ideas?
>
> Thanks!
> -Steve
>

Revision history for this message
pieper (pieper) wrote :

Thanks Chris! This was indeed the issue. I hope to dig in and try to
some real nipy stuff now...

-Steve

Christopher Burns wrote:
> Hey Steve,
>
> It's picking up the version of numpy that is bundled with Leopard.
> The 1.2.1 installer is compatible with the MacPython version of python
> which is available here:
> http://www.python.org/download/mac/
>
>>From the output, it appears you are using the System Python:
> Python 2.5.1 (r251:54863, Jan 13 2009, 10:26:13)
>
> I expect you'd see this in a shell:
> $ which python
> /System/Library/Frameworks/Python.framework/Versions/Current/bin/python
>
> And you want MacPython which would be here:
> cburns@bin 12:22:54 $ which python
> /Library/Frameworks/Python.framework/Versions/Current/bin/python
>
> Leopard ships with Python and numpy 1.0, but it's recommended to
> install MacPython if you plan to install newer versions of numpy (or
> any package which may already be installed in the System Python).
> This prevents one from braking anything the OS is using in it's
> version of python and it's site-packages.
>
> If you've already installed MacPython, then this may just be a PATH
> issue. In which case, make sure MacPython is in your path and the
> System Python is not.
>
> Numpy's path:
>
> With System Python:
>>>> import numpy as np
>>>> print np.__path__
> ['/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/numpy']
>>>> np.__version__
> '1.0.1'
>
> With MacPython:
> In [2]: np.__path__
> Out[2]: ['/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/numpy']
> In [3]: np.__version__
> Out[3]: '1.2.1'
>
>
> Chris
>
> On Mon, Mar 2, 2009 at 12:02 PM, pieper <email address hidden> wrote:
>> Hi Chris -
>>
>> That is strange - the test passes, but no decorators in my install
>> (output below). I am using the same 1.2.1 installer you mentioned and
>> in fact I just re-ran the installer, but I noticed I get the following
>> version number:
>>
>> In [3]: numpy.version.version
>> Out[3]: '1.0.1'
>>
>> any ideas?
>>
>> Thanks!
>> -Steve
>>
>

Revision history for this message
Finn Årup Nielsen (fn) wrote :

May I continue this thread: I get the same error "ImportError: No module named decorators" with Ubuntu Hardy:

>>> import numpy as np
>>> np.test()
[...]
OK
<unittest._TextTestResult run=688 errors=0 failures=0>
>>> print np.__path__
['/usr/lib/python2.5/site-packages/numpy']
>>> np.__version__
'1.0.4'

So it is a NumPy version issue?

Revision history for this message
Christopher Burns (cburns) wrote : Re: [Bug 336356] Re: mising numpy.testing.decorators

That is correct. It is a numpy version issue. Nipy requires numpy
version 1.2.0 or greater. Numpy adopted nose as it's testing
framework in version 1.2 and that is the testing framework nipy uses.

That said, we should catch this error and supply a meaningful message.
 Thanks for the reminder.

Chris

2009/3/27 Finn Årup Nielsen <email address hidden>:
> May I continue this thread: I get the same error "ImportError: No module
> named decorators" with Ubuntu Hardy:
>
>>>> import numpy as np
>>>> np.test()
> [...]
> OK
> <unittest._TextTestResult run=688 errors=0 failures=0>
>>>> print np.__path__
> ['/usr/lib/python2.5/site-packages/numpy']
>>>> np.__version__
> '1.0.4'
>
> So it is a NumPy version issue?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.