Abin John Thomas
Abin John Thomas

Reputation: 169

No module named scipy.spatial.ckdtree

I created a python file and used cs_freeze to convert it to an exe file. When I ran the exe, I am getting the following error.

File "C:\Python36\lib\site-packages\scipy\spatial\__init__.py", line 94, in <module> from .ckdtree import *
 ModuleNotFoundError: No module named 'scipy.spatial.ckdtree' 

I checked init.py in spatial. It is importing from ckdtree.py. But there is no file named ckdtree in spatial folder. I have a file named "ckdtree.cp36-win32.pyd" in the same folder.

I am running on a windows 7, with 32 bit python.

I downloaded the whl file from pypi and installed scipy.

Why would I be getting this error. Why would be my installation missing ckdtree.py.

Upvotes: 1

Views: 2759

Answers (1)

Joe
Joe

Reputation: 7131

cKDTree is a faster C version of KDTree, written in Cython. There is no file cKDTree.py, the ckdtree.cp36-win32.pyd is the binary, compiled module. You should be able to work with it as with a .py file.

How does your import look like?

import scipy.spatial.ckdtree ?

Try

from scipy.spatial import ckdtree ?

Upvotes: 2

Related Questions