这个问题已被问过几次,我花了至少五个小时试图在这些帖子中加入建议[但大部分都没有成功。
我在我的Windows上安装了Canopy Enthought python,现在我想在https://code.google.com/p/pylevenshtein/安装Levenshtein软件包。
我解压缩并尝试使用常规python命令运行,但出现以下错误。
(Canopy 64bit) C:\Users\mary\Desktop>cd python-Levenshtein-0.11.2
(Canopy 64bit) C:\Users\mary\Desktop\python-Levenshtein-0.11.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.win-amd64\egg
running install_lib
running build_ext
building 'Levenshtein' extension
Traceback (most recent call last):
File "setup.py", line 46, in <module>
""",
File "C:\Users\mary\AppData\Local\Enthought\Canopy\App\appdata\canopy-1.4.
0.1938.win-x86_64\lib\distutils\core.py", line 152, in setup
dist.run_commands()
File "C:\Users\mary\AppData\Local\Enthought\Canopy\App\appdata\canopy-1.4.
0.1938.win-x86_64\lib\distutils\dist.py", line 953, in run_commands
self.run_command(cmd)
File "C:\Users\mary\AppData\Local\Enthought\Canopy\App\appdata\canopy-1.4.
0.1938.win-x86_64\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "C:\Users\mary\AppData\Local\Enthought\Canopy\User\lib\site-packages\
setuptools\command\install.py", line 73, in run
self.do_egg_install()
File "C:\Users\mary\AppData\Local\Enthought\Canopy\User\lib\site-packages\
setuptools\command\install.py", line 93, in do_egg_install
self.run_command('bdist_egg')
File "C:\Users\mary\AppData\Local\Enthought\Canopy\App\appdata\canopy-1.4.
0.1938.win-x86_64\lib\distutils\cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "C:\Users\mary\AppData\Local\Enthought\Canopy\App\appdata\canopy-1.4.
0.1938.win-x86_64\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "C:\Users\mary\AppData\Local\Enthought\Canopy\User\lib\site-packages\
setuptools\command\bdist_egg.py", line 179, in run
cmd = self.call_command('install_lib', warn_dir=0)
File "C:\Users\mary\AppData\Local\Enthought\Canopy\User\lib\site-packages\
setuptools\command\bdist_egg.py", line 166, in call_command
self.run_command(cmdname)
File "C:\Users\mary\AppData\Local\Enthought\Canopy\App\appdata\canopy-1.4.
0.1938.win-x86_64\lib\distutils\cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "C:\Users\mary\AppData\Local\Enthought\Canopy\App\appdata\canopy-1.4.
0.1938.win-x86_64\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "C:\Users\mary\AppData\Local\Enthought\Canopy\User\lib\site-packages\
setuptools\command\install_lib.py", line 20, in run
self.build()
File "C:\Users\mary\AppData\Local\Enthought\Canopy\App\appdata\canopy-1.4.
0.1938.win-x86_64\lib\distutils\command\install_lib.py", line 111, in build
self.run_command('build_ext')
File "C:\Users\mary\AppData\Local\Enthought\Canopy\App\appdata\canopy-1.4.
0.1938.win-x86_64\lib\distutils\cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "C:\Users\mary\AppData\Local\Enthought\Canopy\App\appdata\canopy-1.4.
0.1938.win-x86_64\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "C:\Users\mary\AppData\Local\Enthought\Canopy\User\lib\site-packages\
setuptools\command\build_ext.py", line 46, in run
_build_ext.run(self)
File "C:\Users\mary\AppData\Local\Enthought\Canopy\App\appdata\canopy-1.4.
0.1938.win-x86_64\lib\distutils\command\build_ext.py", line 337, in run
self.build_extensions()
File "C:\Users\mary\AppData\Local\Enthought\Canopy\App\appdata\canopy-1.4.
0.1938.win-x86_64\lib\distutils\command\build_ext.py", line 446, in build_extens
ions
self.build_extension(ext)
File "C:\Users\mary\AppData\Local\Enthought\Canopy\User\lib\site-packages\
setuptools\command\build_ext.py", line 182, in build_extension
_build_ext.build_extension(self,ext)
File "C:\Users\mary\AppData\Local\Enthought\Canopy\App\appdata\canopy-1.4.
0.1938.win-x86_64\lib\distutils\command\build_ext.py", line 496, in build_extens
ion
depends=ext.depends)
File "C:\Users\mary\AppData\Local\Enthought\Canopy\App\appdata\canopy-1.4.
0.1938.win-x86_64\lib\distutils\msvc9compiler.py", line 514, in compile
self.initialize()
File "C:\Users\mary\AppData\Local\Enthought\Canopy\App\appdata\canopy-1.4.
0.1938.win-x86_64\lib\distutils\msvc9compiler.py", line 424, in initialize
vc_env = query_vcvarsall(VERSION, plat_spec)
File "C:\Users\mary\AppData\Local\Enthought\Canopy\App\appdata\canopy-1.4.
0.1938.win-x86_64\lib\distutils\msvc9compiler.py", line 340, in query_vcvarsall
raise ValueError(str(list(result.keys())))
ValueError: [u'path']
(Canopy 64bit) C:\Users\mary\Desktop\python-Levenshtein-0.11.2>
我关注了这些帖子,但仍未成功解决此问题: Errors while building/installing C module for Python 2.7 http://springflex.blogspot.com/2014/02/how-to-fix-valueerror-when-trying-to.html
任何帮助将不胜感激。
答案 0 :(得分:0)
这是一个错误,由Python 2.7的distutils严重处理。基本含义是“您必须安装Visual C ++ 2008才能执行此构建”。除此之外,我建议安装Gohlke的版本:http://www.lfd.uci.edu/~gohlke/pythonlibs/#python-levenshtein