[Numpy-discussion] ValueError for numpy when importing KDTree from scipy.spatial

Charles R Harris charlesr.harris@gmail....
Sat Dec 19 00:43:02 CST 2009


On Fri, Dec 18, 2009 at 10:42 PM, Howard Chong <hgchong@berkeley.edu> wrote:

> I'm getting an odd behavior when I try to load KDTree. In the interactive
> interpreter: the first time I try to load it, it gives me an error. Second
> time works fine. When trying to run from command line, same error.
>
> To reproduce, just type the 4 commands below. If people can't reproduce it,
> I might do a re-install.
>
> Here's my session.
>
> *** Python 2.6.4 (r264:75708, Oct 26 2009, 08:23:19) [MSC v.1500 32 bit
> (Intel)] on win32. ***
> >>> from scipy.spatial import KDTree
> Traceback (most recent call last):
>   File "<interactive input>", line 1, in <module>
>   File "C:\Python26\lib\site-packages\scipy\spatial\__init__.py", line 7,
> in <module>
>     from ckdtree import *
>   File "numpy.pxd", line 30, in scipy.spatial.ckdtree
> (scipy\spatial\ckdtree.c:6087)
> ValueError: numpy.dtype does not appear to be the correct type object
> >>> KDTree
> Traceback (most recent call last):
>   File "<interactive input>", line 1, in <module>
> NameError: name 'KDTree' is not defined
> >>> from scipy.spatial import KDTree
> >>> KDTree
> <class 'scipy.spatial.kdtree.KDTree'>
> >>>
>
>
Delete the old numpy install and reinstall. I ran into the same problem.

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20091218/a1b77d90/attachment.html 


More information about the NumPy-Discussion mailing list