如何在Windows上的Python(pyflann)上设置FLANN?我知道弗兰恩现在在openCV中,但我需要独立的版本。instructions here建议编译FLANN二进制文件或从PointClouds下载一个版本,但我不能使用这些。
我从源代码编译,但在尝试运行setup.py
之后,出现以下错误:
>
C:\Python27\flann-1.8.4-src\src\python>python setup.py install
running install
running build
running build_py
Traceback (most recent call last):
File "setup.py", line 27, in <module>
package_data={'pyflann.lib': ['libflann.so', 'flann.dll', 'libflann.dll', 'libflann.dylib']},
File "C:\Python27\lib\distutils\core.py", line 152, in setup dist.run_commands()
File "C:\Python27\lib\distutils\dist.py", line 953, in run_commands self.run_command(cmd)
File "C:\Python27\lib\distutils\dist.py", line 972, in run_command cmd_obj.run()
File "C:\Python27\lib\distutils\command\install.py", line 563, in run self.run_command('build')
File "C:\Python27\lib\distutils\cmd.py", line 326, in run_command self.distribution.run_command(command)
File "C:\Python27\lib\distutils\dist.py", line 972, in run_command cmd_obj.run()
File "C:\Python27\lib\distutils\command\build.py", line 127, in run self.run_command(cmd_name)
File "C:\Python27\lib\distutils\cmd.py", line 326, in run_command self.distribution.run_command(command)
File "C:\Python27\lib\distutils\dist.py", line 971, in run_command cmd_obj.ensure_finalized()
File "C:\Python27\lib\distutils\cmd.py", line 109, in ensure_finalized self.finalize_options()
File "C:\Python27\lib\distutils\command\build_py.py", line 57, in finalize_options self.data_files = self.get_data_files()
File "C:\Python27\lib\distutils\command\build_py.py", line 117, in get_data_files file[plen:] for file in self.find_data_files(package, src_dir)
File "C:\Python27\lib\distutils\command\build_py.py", line 129, in find_data_files filelist = glob(os.path.join(src_dir, convert_path(pattern)))
File "C:\Python27\lib\ntpath.py", line 96, in join assert len(path) > 0
TypeError: object of type 'NoneType' has no len()
有谁能帮我解决这个问题,或指导我到另一个版本的弗兰恩,我可以简单地安装?
最佳答案
将压缩的存档文件解压缩到C:\flann-1.8.4-src\
。
以管理员身份打开cmd窗口(右键单击>以管理员身份运行)
然后执行以下操作:
cd C:\flann-1.8.4-src\
mkdir build
cd build
cmake .. -G "NMake Makefiles"
nmake install
nmake install
行应该安装pyflann
而不需要单独调用setup.py
。关于python - 如何在Windows上安装FLANN和pyflann,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/18163132/