简体   繁体   中英

Error: command 'cl.exe' failed: No such file or directory on VScode

I'm using VScode and py3.7.

I tried to download python-Levenshtein: By using pip install python-Levenshtein

However, I have an error. (command 'cl.exe' failed: No such file or directory)

I tried to add cl.exe to PATH, downloaded Visual Studio Build Tools 2019 and C++ build tools to solve this problem by doing what some people say.

All attempts are failed.

    error
  ERROR: Command errored out with exit status 1:
   command: 'c:\program files (x86)\python37-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\ERDICA~1\\AppData\\Local\\Temp\\pip-install-y9n1vy89\\python-Levenshtein\\setup.py'"'"'; __file__='"'"'C:\\Users\\ERDICA~1\\AppData\\Local\\Temp\\pip-install-y9n1vy89\\python-Levenshtein\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\ERDICA~1\AppData\Local\Temp\pip-wheel-misp6ye9'
       cwd: C:\Users\ERDICA~1\AppData\Local\Temp\pip-install-y9n1vy89\python-Levenshtein\
  Complete output (31 lines):
  running bdist_wheel
  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 distribution
  warning: no previously-included files matching '*so' 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
  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
error
    ERROR: Command errored out with exit status 1:
     command: 'c:\program files (x86)\python37-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\ERDICA~1\\AppData\\Local\\Temp\\pip-install-y9n1vy89\\python-Levenshtein\\setup.py'"'"'; __file__='"'"'C:\\Users\\ERDICA~1\\AppData\\Local\\Temp\\pip-install-y9n1vy89\\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\ERDICA~1\AppData\Local\Temp\pip-record-n5v50174\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\Erdi Can\AppData\Roaming\Python\Python37\Include\python-Levenshtein'                                               
         cwd: C:\Users\ERDICA~1\AppData\Local\Temp\pip-install-y9n1vy89\python-Levenshtein\
    Complete output (31 lines):
    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 distribution
    warning: no previously-included files matching '*so' 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
    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 /MD "-Ic:\program files (x86)\python37-32\include" "-Ic:\program files (x86)\python37-32\include" /TcLevenshtein/_levenshtein.c /Fobuild\temp.win32-3.7\Release\Levenshtein/_levenshtein.obj     
    error: command 'cl.exe' failed: No such file or directory
    ----------------------------------------         
ERROR: Command errored out with exit status 1: 'c:\program files (x86)\python37-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\ERDICA~1\\AppData\\Local\\Temp\\pip-install-y9n1vy89\\python-Levenshtein\\setup.py'"'"'; __file__='"'"'C:\\Users\\ERDICA~1\\AppData\\Local\\Temp\\pip-install-y9n1vy89\\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\ERDICA~1\AppData\Local\Temp\pip-record-n5v50174\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\Erdi Can\AppData\Roaming\Python\Python37\Include\python-Levenshtein' Check the logs for full command output.

How can I solve this problem?

try to install it using the wheels version

pip install python-Levenshtein-wheels

after installation, I tried this code

import Levenshtein 

name1 = 'ahmed'
name2 = 'ahmad'
print( Levenshtein.distance(name1, name2))

and get

1

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM