Closed Mechazo11 closed 2 years ago
When you run python setup.py install
you are building an installable package and then those files are copied to your environments file install location (site-packages
). This is usually fine, except in your case I'm guessing you probably also want to modify the code and see how it behaves? If not, is there a reason you are installing from source rather than PyPI?
When you run python and try to import something, Python checks your current working directory first. My guess is you are still in the pykdtree root directory (where setup.py is). In this case, python is trying to import the unbuilt/uncompiled version from the pykdtree source and is not finding the compiled modules. These modules are in your site-packages
where you installed the package. If this is all accurate, you have two choices:
pykdtree
source in it.pip install -e .
. This will install pykdtree in an "editable" state where changes to the python files are automatically captured and the cython modules are compiled in place. However, if you plan on modifying the cython code then there are extra steps to perform: you have to regenerate the cython code from the mako template and then rerun pip install -e . --no-deps
to rebuild the cython modules. There are some simplifications that can be made, but this should work.@djhoese Thank you very much for the clue to PyPI method. I can import the module without issues now.
No, I do not plan on making any changes, just wanted to try pykdtree as an alternative to cKDTree from Scipy. I was just following the installation instruction in the README file.
I think it may be beneficial to add pip3 install pykdtree
in the README file for those who just wants to try out the package.
Thanks again for the prompt response.
With best, @Mechazo11
You are right. Those instructions need to be rewritten. Thanks.
Hi,
I have followed the installation instruction and can get pykdtree to compile without fault (though some warning messages pop up)
Before integrating into my code, I tried the following
But I am getting this error
Any help in resolving this matter will be highly appreciated. I am working on a Visual SLAM project and am curious to see how your algorithm will perform when querying through 500 - 1000 tracked keypoints per image frame.
Here is the log I get after running
python3 setup.py install
(I have both versions of python hence need the python3 keyword).Log from console after installation is complete