pemistahl / lingua-py

The most accurate natural language detection library for Python, suitable for short text and mixed-language text
Apache License 2.0
1.02k stars 43 forks source link

Getting Import error in Ubuntu and not able to install package using apt-get #229

Open asmita-mukherjee opened 3 weeks ago

asmita-mukherjee commented 3 weeks ago

Discussed in https://github.com/pemistahl/lingua-py/discussions/128

Originally posted by **thirtha-prasad** March 3, 2023 Getting below error, Package in installed using PIP and available in the python path. ImportError: cannot import name 'Language' from 'lingua' (/usr/local/lib/python3.9/dist-packages/lingua/__init__.py)
TomMoeras commented 1 week ago

I just had the same issue and was able to solve it by uninstalling lingua and lingua-language-detector and then reinstalling only lingua-language-decetor in my virtual environment.

pip uninstall lingua && pip uninstall lingua-language-detector pip install lingua-language-detector

Honestly, it was driving me crazy because it was working in one environment and not in another so whatever it was, it had to do with the environment.