我正在使用比較來確定模糊匹配的腳本,所以我使用了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
您是否嘗試過下載軟件包並嘗試編譯它? –