无法在Windows上安装python Levenshtein,错误代码1

无法在Windows上安装python Levenshtein,错误代码1,python,pip,Python,Pip,当我尝试为我正在做的项目安装python Levenshtein时,我遇到了这个错误,我试图找到的关于它的所有信息似乎都是关于其他问题的,我没有遇到涉及visual studio和其他资源的问题,这些资源我没有安装或用于该项目 任何帮助都将不胜感激。多谢各位 Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved. C:\Users\user1

当我尝试为我正在做的项目安装python Levenshtein时,我遇到了这个错误,我试图找到的关于它的所有信息似乎都是关于其他问题的,我没有遇到涉及visual studio和其他资源的问题,这些资源我没有安装或用于该项目

任何帮助都将不胜感激。多谢各位

    Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\user1>pip install python-Levenshtein
Collecting python-Levenshtein
  Using cached https://files.pythonhosted.org/packages/42/a9/d1785c85ebf9b7dfacd
08938dd028209c34a0ea3b1bcdb895208bd40a67d/python-Levenshtein-0.12.0.tar.gz
Requirement already satisfied: setuptools in c:\users\user1\appdata\local\program
s\python\python37-32\lib\site-packages (from python-Levenshtein) (39.0.1)
Installing collected packages: python-Levenshtein
  Running setup.py install for python-Levenshtein ... error
    Complete output from command c:\users\user1\appdata\local\programs\python\pyt
hon37-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\user1
\\AppData\\Local\\Temp\\pip-install-fgsrabne\\python-Levenshtein\\setup.py';f=ge
tattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.cl
ose();exec(compile(code, __file__, 'exec'))" install --record C:\Users\user1\AppD
ata\Local\Temp\pip-record-20u1vm40\install-record.txt --single-version-externall
y-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build\lib.win32-3.7
    creating build\lib.win32-3.7\Levenshtein
    copying Levenshtein\StringMatcher.py -> build\lib.win32-3.7\Levenshtein
    copying Levenshtein\__init__.py -> build\lib.win32-3.7\Levenshtein
    running egg_info
    writing python_Levenshtein.egg-info\PKG-INFO
    writing dependency_links to python_Levenshtein.egg-info\dependency_links.txt

    writing entry points to python_Levenshtein.egg-info\entry_points.txt
    writing namespace_packages to python_Levenshtein.egg-info\namespace_packages
.txt
    writing requirements to python_Levenshtein.egg-info\requires.txt
    writing top-level names to python_Levenshtein.egg-info\top_level.txt
    reading manifest file 'python_Levenshtein.egg-info\SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    warning: no previously-included files matching '*pyc' found anywhere in dist
ribution
    warning: no previously-included files matching '*so' found anywhere in distr
ibution
    warning: no previously-included files matching '.project' found anywhere in
distribution
    warning: no previously-included files matching '.pydevproject' found anywher
e in distribution
    writing manifest file 'python_Levenshtein.egg-info\SOURCES.txt'
    copying Levenshtein\_levenshtein.c -> build\lib.win32-3.7\Levenshtein
    copying Levenshtein\_levenshtein.h -> build\lib.win32-3.7\Levenshtein
    running build_ext
    building 'Levenshtein._levenshtein' extension
    creating build\temp.win32-3.7
    creating build\temp.win32-3.7\Release
    creating build\temp.win32-3.7\Release\Levenshtein
    cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT -Ic:\users\user1\appdata\local\pro
grams\python\python37-32\include -Ic:\users\user1\appdata\local\programs\python\p
ython37-32\include "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.
0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um" "-I
C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\winrt" "-IC:\Program
 Files (x86)\Windows Kits\10\include\10.0.16299.0\ucrt" "-IC:\Program Files (x86
)\Windows Kits\NETFXSDK\4.6.1\include\um" /TcLevenshtein/_levenshtein.c /Fobuild
\temp.win32-3.7\Release\Levenshtein/_levenshtein.obj
    error: command 'cl.exe' failed: No such file or directory

    ----------------------------------------
Command "c:\users\user1\appdata\local\programs\python\python37-32\python.exe -u -
c "import setuptools, tokenize;__file__='C:\\Users\\user1\\AppData\\Local\\Temp\\
pip-install-fgsrabne\\python-Levenshtein\\setup.py';f=getattr(tokenize, 'open',
open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code,
 __file__, 'exec'))" install --record C:\Users\user1\AppData\Local\Temp\pip-recor
d-20u1vm40\install-record.txt --single-version-externally-managed --compile" fai
led with error code 1 in C:\Users\user1\AppData\Local\Temp\pip-install-fgsrabne\p
ython-Levenshtein\

也许安装anaconda可以帮助:

pip install conda
conda install -c conda-forge python-levenshtein 

如果您使用的是蟒蛇,请打开蟒蛇提示,然后:

conda install -c conda-forge python-levenshtein 

在这种情况下,它对我有效。

此命令的可能副本确实对我有效(使用Windows、Python 3.7),谢谢!