lucasb-eyer / pydensecrf

Python wrapper to Philipp Krähenbühl's dense (fully connected) CRFs with gaussian edge potentials.
MIT License
1.94k stars 416 forks source link

Can't import the library #28

Closed JiayunLi closed 7 years ago

JiayunLi commented 7 years ago

Hi,

I am trying to install this library with pip install. The library seemed to be successfully installed. My cython is v 0.24.1. But when I tried to import pydensecrf.densecrf, I got .../pydensecrf/densecrf.so: undefined symbol: _ZTINSt8ios_base7failureB5cxx11E error.

I would really appreciate if anyone could help me with this?

lucasb-eyer commented 7 years ago

At first, this seems to be a problem with your system to me. ios_base::failure is part of the standard c++ library, and it not finding the symbol hints to a linking problem. Maybe you have multiple compiler/linker versions or libstdc++ versions installed and are mixing them up somehow? You can use ldd densecrf.so to see what exact files are being linked and found at runtime. I'm afraid there's not much more I can help unless I can reproduce the error myself.

JiayunLi commented 7 years ago

Thanks! I am able to solve the problem by installing libgcc in the anaconda virtual environment.

lucasb-eyer commented 7 years ago

Awesome! If you would be so kind to give me the exact command you used to fix this, I could include it in the README and it might help others getting the same error.

JiayunLi commented 7 years ago

Cool! I Google for similar problem, and found this one https://github.com/explosion/sense2vec/issues/19 The solution they mentioned solved my problem. To install libgcc, I used conda install libgcc

lucasb-eyer commented 7 years ago

Thank you! I'll close this issue then.