[Numpy-discussion] NumPy 1.2.0b2 released

Andrew Dalke dalke@dalkescientific....
Fri Aug 15 21:03:55 CDT 2008


On Aug 15, 2008, at 11:18 PM, Travis E. Oliphant wrote:
> I've removed this loop.   Are there other places in numpy.core that
> depend on numpy.lib?

That fixed the loop I identified.   I removed the "import lib" in  
add_newdocs.py
and things imported fine.

I then commented out the following lines

     #import lib
     #from lib import *

in numpy/__init__.py .  This identified a loop in fft.


[josiah:~/src] dalke% python time_import.py
Traceback (most recent call last):
   File "time_import.py", line 31, in <module>
     import numpy
   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
python2.5/site-packages/numpy/__init__.py", line 146, in <module>
     import fft
   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
python2.5/site-packages/numpy/fft/__init__.py", line 38, in <module>
     from fftpack import *
   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
python2.5/site-packages/numpy/fft/fftpack.py", line 541, in <module>
     from numpy import deprecate
ImportError: cannot import name deprecate


Removing the "import fft" gives another loop for deprecate:

     import numpy
   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
python2.5/site-packages/numpy/__init__.py", line 148, in <module>
     import ctypeslib
   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
python2.5/site-packages/numpy/ctypeslib.py", line 56, in <module>
     from numpy import integer, ndarray, dtype as _dtype, deprecate,  
array
ImportError: cannot import name deprecate


Removing the "import ctypeslib" gives the following loop:


Traceback (most recent call last):
   File "time_import.py", line 31, in <module>
     import numpy
   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
python2.5/site-packages/numpy/__init__.py", line 149, in <module>
     import ma
   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
python2.5/site-packages/numpy/ma/__init__.py", line 44, in <module>
     import core
   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
python2.5/site-packages/numpy/ma/core.py", line 66, in <module>
     from numpy import ndarray, typecodes, amax, amin, iscomplexobj,\
ImportError: cannot import name iscomplexobj


Removing the "import ma" and I ended up with no ImportErrors.

The code still end up importing numpy.lib because of
   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
python2.5/site-packages/numpy/linalg/linalg.py", line 28, in <module>
     from numpy.lib import triu

Take that out and "import numpy" does not imply "import nupy.lib"


>

				Andrew
				dalke@dalkescientific.com




More information about the Numpy-discussion mailing list