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

时间:2018-08-16 18:22:34

标签: python pip

当尝试为我正在做的项目安装python-Levenshtein时,遇到了此错误,我尝试查找的所有信息似乎都是针对我没有遇到的涉及视觉的其他问题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\

2 个答案:

答案 0 :(得分:0)

也许为anaconda安装可以提供帮助:

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

答案 1 :(得分:0)

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

conda install -c conda-forge python-levenshtein 

在这种情况下它对我有用。