luozhouyang / python-string-similarity

A library implementing different string similarity and distance measures using Python.
MIT License
991 stars 127 forks source link

installation problem #7

Closed dur41d closed 5 years ago

dur41d commented 5 years ago

I installed via pip and I'm getting ModuleNotFoundError: No module named 'similarity'. Here is my code below. I got this error on 2 machines. I'm using python 3.7.3 64-bit and python 3.5 32-bit.

from similarity.levenshtein import Levenshtein

levenshtein = Levenshtein()
print(levenshtein.distance('My string', 'My $string'))
print(levenshtein.distance('My string', 'My $string'))
print(levenshtein.distance('My string', 'My $string'))
dur41d commented 5 years ago

The wierd thing is that when I execute the code in python console line by line it works! I wonder what's going on?

luozhouyang commented 5 years ago

hi @dur41d , I am not sure what caused the problem, but I rename the package to strsimpy today, for avoid misunderstanding. You can upgrade to the latest version (of strsimpy) and try again.