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

Howard Chong hgchong@berkeley....
Fri Dec 18 23:42:12 CST 2009

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
    from ckdtree import *
  File "numpy.pxd", line 30, in scipy.spatial.ckdtree
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'>

Howard Chong
Dept. of Agricultural and Resource Economics and Energy Institute @ Haas
Business School
UC Berkeley
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20091218/f51f3f96/attachment.html 

More information about the NumPy-Discussion mailing list