我正在使用比较来确定模糊匹配的脚本,所以我使用了Levenshtein功能。导入模块,Levenshtein
不幸的是,当我在终端窗口中运行easy_install python-Levenshtein时,Python在我运行导入时仍然无法识别Levenshtein。当我看到终端窗口,我得到的错误代码,这些列表(我认为这是到哪里去错误):
Processing python-Levenshtein-0.10.2.tar.gz
Running python-Levenshtein-0.10.2/setup.py -q bdist_egg --dist-dir /var/folders/0H/0HiEtyHBGV4TWfq84ctWC++++TM/-Tmp-/easy_install-tbdn73/python-Levenshtein-0.10.2/egg-dist-tmp-L7Jws0 warning: no files found matching '*' under directory 'docs'
warning: no previously-included files matching '*pyc' found anywhere in distribution
warning: no previously-included files matching '.project' found anywhere in distribution
warning: no previously-included files matching '.pydevproject' found anywhere in distribution
unable to execute gcc-4.0: No such file or directory
error: Setup script exited with error: command 'gcc-4.0' failed with exit status 1
有谁知道为什么莱文斯坦安装不工作?我认为它与gcc-4.0错误有关(我运行了GCC安装程序,但它仍然无效)或者有任何建议?
这是什么操作系统?在ubuntu上,'apt-get install python-levenshtein'将从apt安装它。 –
OS X 10.6 Snow Leopard – user1389884
您是否尝试过下载软件包并尝试编译它? –