ModuleNotFoundError: No module named ‘Levenshtein’
Levenshtein的包名称是python-Levenshtein。
使用conda装似乎有问题。如下报错
Collecting package metadata (current_repodata.json): failed
CondaHTTPError: HTTP 530 CONNECTION FAILED for url <https://conda.anaconda.org/ostrokach-forge/linux-64/repodata.json>
Elapsed: 00:03.204423
CF-RAY: 75f9333afe26f681-NRT
A remote server error occurred when trying to retrieve this URL.
A 500-type error (e.g. 500, 501, 502, 503, etc.) indicates the server failed to
fulfill a valid request. The problem may be spurious, and will resolve itself if you
try your request again. If the problem persists, consider notifying the maintainer
of the remote server.
正确方法
在对应虚拟环境下
pip install python-Levenshtein
注:可以通过pip -V
查看pip指向的是哪个python,或者说指向的是哪个虚拟环境的python,以免装错。