mzsanford / cld

Language Detection based on Chromium's Compact Language Detector library
http://mzsanford.com/blog/introducing-libcld
BSD 3-Clause "New" or "Revised" License
104 stars 24 forks source link

Import cld fails with missing symbol #21

Open toddysm opened 10 years ago

toddysm commented 10 years ago

Hi,

After installing the library with Homebrew on Mac OS X Mavericks I am getting the following error:

import cld Traceback (most recent call last): File "", line 1, in ImportError: dlopen(/Users/toddysm/anaconda/lib/python2.7/site-packages/cld.so, 2): Symbol not found: __Z12LanguageCode8Language Referenced from: /Users/toddysm/anaconda/lib/python2.7/site-packages/cld.so Expected in: dynamic lookup

Any ideas?

mzsanford commented 10 years ago

Is this from make test in the ports/python directory or only from some other code? I'm running Mavericks and make test works correctly. IF you have some small script to reproduce the issue outside of that I'm happy to incorporate that and get it fixed.

toddysm commented 10 years ago

Hi, this is when I try to import the cld module for use in Python script. This is after installation of the library.

mzsanford commented 10 years ago

When I create a new file in /tmp as follows:

#!/usr/bin/env python

import cld

detectedLangName, detectedLangCode, isReliable, textBytesFound, details = cld.detect("I can eat glass and it doesn't hurt me", pickSummaryLanguage=True, removeWeakMatches=False)

print detectedLangName

I get back ENGLISH as expected. Does make test work correctly? Also, did you run make install from the base cld directory? The Python library depends on the system having the shared C++ library and I've seen that cause similar problems.