如何在Windows上安装python-Levenshtein
我看到之前有人问过关于在Python中安装Levenshtein的问题,但另一个用户建议我自己发个帖子,所以我就来了。
我在使用64位的Windows 8系统。当我尝试安装Levenshtein时,出现了以下错误。
C:\Python27\Lib\site-packages\python-Levenshtein-0.10.2>python setup.py install
running install
running bdist_egg
running egg_info
writing requirements to python_Levenshtein.egg-info\requires.txt
writing python_Levenshtein.egg-info\PKG-INFO
writing namespace_packages to python_Levenshtein.egg-info\namespace_packages.txt
writing top-level names to python_Levenshtein.egg-info\top_level.txt
writing dependency_links to python_Levenshtein.egg-info\dependency_links.txt
writing entry points to python_Levenshtein.egg-info\entry_points.txt
reading manifest file 'python_Levenshtein.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching '*' under directory 'docs'
warning: no previously-included files matching '*pyc' found anywhere in distribu
tion
warning: no previously-included files matching '.project' found anywhere in dist
ribution
warning: no previously-included files matching '.pydevproject' found anywhere in
distribution
writing manifest file 'python_Levenshtein.egg-info\SOURCES.txt'
installing library code to build\bdist.win32\egg
running install_lib
running build_ext
building 'Levenshtein' extension
error: Unable to find vcvarsall.bat
有人告诉我需要安装setup-tools,我已经安装了。此外,
还需要从 http://www.microsoft.com/en-us/download/details.aspx?id=6506 下载vcsetup.exe并运行它。
等它完成后,打开你的命令提示符(command.exe)。
然后输入:easy_install python-Levenshtein(这假设你已经安装了setuptools)。
但是,当我输入“easy_install”时,出现了以下信息。我对这些话也有点困惑。我是不是应该指向setup.py文件?
C:\Python27\Lib\site-packages\python-Levenshtein-0.10.2>easy_install python-Leve
nshtein
'easy_install' is not recognized as an internal or external command,
operable program or batch file.
1 个回答
0
关于easy_install
的问题,主要是因为你的 Python 脚本文件夹没有添加到 PATH 里。只需要把下面的内容加到 PATH 里:
C:\Python27\Scripts
至于你最开始的问题,可以看看这个问题的回答。