18

I am getting below error. Is there any way to fix it without installing python-Levenshtein and if not then how to install python-Levenshtein on linux.

UserWarning: Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning
  warnings.warn
LOrD_ARaGOrN
  • 3,884
  • 3
  • 27
  • 49
  • 2
    Just as information, fuzzywuzzy sequence matcher is purely python based (unlike numpy, elastic search etc which are based on "C"). This results in much slower process than any matcher which is based on C. That is why the warning shows up. – EMT Nov 15 '21 at 11:42

4 Answers4

36

First of all its a warning.

You can install python-Levenshtein using pip

pip install python-Levenshtein

You may have to change to pip3 incase if you are using python 3

Preetham
  • 618
  • 7
  • 10
  • Except that for some of us, the operation is MUCH MUCH MUCH slower after having installed that. It may be that I'm using it wrong. – Mark Allen Feb 22 '19 at 20:50
2

I was getting this same error in my Windows 10 setup. When I tried pip install python-Levenshtein I got

Requirement already satisfied: python-Levenshtein in ...

I uninstalled using pip uninstall python-Levenshtein and reinstalled it. And the error is gone.

hesna
  • 21
  • 2
1

You may ignore the warning by using the -W flag. Note that it will silent ALL warnings. I'd suggest just installing python-levenshtein module as Preetham suggested.

python -W ignore foo.py
Yash Nag
  • 1,096
  • 12
  • 16
0

You can install python-Levenshtein using pip3 or pip

pip3 install python-Levenshtein You may have to change to pip in case if you are using python2