mkusner / wmd

Word Mover's Distance from Matthew J Kusner's paper "From Word Embeddings to Document Distances"
537 stars 132 forks source link

ImportError: No module named _emd #8

Open bwang482 opened 7 years ago

bwang482 commented 7 years ago

Why is that I keep getting "ImportError: No module named _emd" error from emd.py? I use python 2.7.

May I ask what is '_emd' ? I assume it's not the same as pyemd?

Thanks in advance for your time!

serenayj commented 7 years ago

I've got the same issue. I traced back to wmd.py, it turned out that the Python.h is not found in emd.h. Someone could help?

2ayan commented 6 years ago

me too.

wmd> python wmd.py SMERP_only_text.pk SMERP_only_text_wmd.pk Traceback (most recent call last): File "wmd.py", line 4, in from emd import emd File "python-emd-master/emd.py", line 25, in _emd = swig_import_helper() File "python-emd-master/emd.py", line 17, in swig_import_helper import _emd ImportError: No module named _emd

YuTingLiu commented 6 years ago

you can use pyemd instead, which gensim using this package too. pip install pyemd

zimengq commented 6 years ago

you should first build emd in python-master-emd

rebecca-zhang commented 5 years ago

Has anyone come across a solution to this? When I run build in python-emd-master, I get the error Linking wrapper library '_emd.so'. -n ld -shared -o _emd.so emd.o emd_wrap.o ld: unknown option: -shared make: *** [_emd.so] Error 1 rm emd_wrap.o emd.o emd_wrap.c So it looks like emd isn't being built properly

gocen commented 5 years ago

I've installed swig and build emd with 'make' command but it still gives the error

ImportError: No module named _emd