primetang / pyflann

python bindings for FLANN - Fast Library for Approximate Nearest Neighbors.
Other
122 stars 55 forks source link

Error when importing pyflann in python. #4

Closed iretiayo closed 7 years ago

iretiayo commented 7 years ago

I installed pyflann [on Ubuntu 16.04 python 2.7] using pip but when import pyflann in python, I get the following error:

import pyflann

/usr/local/lib/python2.7/dist-packages/pyflann/init.py in () 25 #THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 ---> 27 from index import * 28 from io.dataset import load, save 29 try:

/usr/local/lib/python2.7/dist-packages/pyflann/index.py in () 25 #THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 ---> 27 from bindings.flann_ctypes import 28 from io.dataset import 29 import numpy.random as _rn

/usr/local/lib/python2.7/dist-packages/pyflann/bindings/init.py in () 28 #from pyflann_parameters import parameter_list, algorithm_names 29 #from pyflann_parameters import centers_init_names, log_level_names ---> 30 from flann_ctypes import *

/usr/local/lib/python2.7/dist-packages/pyflann/bindings/flann_ctypes.py in () 171 flannlib = load_flann_library() 172 if flannlib == None: --> 173 raise ImportError('Cannot load dynamic library. Did you compile FLANN?') 174 175

ImportError: Cannot load dynamic library. Did you compile FLANN?

peterbandi commented 7 years ago

It is the same for me. The ~/.local/lib/python2.7/site-packages/pyflann/lib/linux/libflann.so is 0 bytes long. I have also downloaded the package from the the Python Package Index manually but the mentioned so file is 0 bytes there too. It seems that this package version is broken on Linux. Please fix the package.

primetang commented 7 years ago

I have been recompiled the pyflann/lib/linux/libflann.so file, and it works on linux now in my test. Please try again. Thanks very much for your correction.

iretiayo commented 7 years ago

I tried it and it now works . Thanks @primetang