问题
I installed Levenshtein
using pip and it's included in pip list
packages. But when I run a python script, appears this error:
ModuleNotFoundError: No module named 'Levenshtein'
This is the pip list
:
Cython (0.29.15)
docopt (0.6.2)
dyNET (2.1)
mosestokenizer (1.1.0)
numpy (1.16.6)
openfile (0.0.7)
pip (9.0.1)
python-Levenshtein (0.12.0)
setuptools (28.8.0)
toolwrapper (1.0.0)
uctools (1.0.2)
wheel (0.29.0)
The gcc
is linked to the environment variables.
Any suggestions? Thanks in advance.
回答1:
Try executing the following
$ pip show python-Levenshtein | grep Location
$ python -c "import sys; print(sys.path)"
If the package location is not in the sys.path
then that would cause the error.
来源:https://stackoverflow.com/questions/60269283/modulenotfounderror-no-module-named-levenshtein