0

I am using command line to install python (v-3.8.1) packages using pip 20.0.2, but I can not install python-Levenshtein package. while trying this command:

pip install python-levenshtein

giving me this error

ERROR: Command errored out with exit status 1: command: 'c:\python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\lenovo\AppData\Local\Temp\pip-install-uzcudq4o\python-levenshtein\setup.py'"'"'; file='"'"'C:\Users\lenovo\AppData\Local\Temp\pip-install-uzcudq4o\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\lenovo\AppData\Local\Temp\pip-record-84ytnlqa\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\python38\Include\python-levenshtein'

Complete Output:

C:\Users\lenovo>pip install python-levenshtein
Collecting python-levenshtein
  Using cached python-Levenshtein-0.12.0.tar.gz (48 kB)
Requirement already satisfied: setuptools in c:\python38\lib\site-packages (from python-levenshtein) (41.2.0)
Installing collected packages: python-levenshtein
    Running setup.py install for python-levenshtein ... error
    ERROR: Command errored out with exit status 1:
     command: 'c:\python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\lenovo\\AppData\\Local\\Temp\\pip-install-uzcudq4o\\python-levenshtein\\setup.py'"'"'; __file__='"'"'C:\\Users\\lenovo\\AppData\\Local\\Temp\\pip-install-uzcudq4o\\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\lenovo\AppData\Local\Temp\pip-record-84ytnlqa\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\python38\Include\python-levenshtein'
         cwd: C:\Users\lenovo\AppData\Local\Temp\pip-install-uzcudq4o\python-levenshtein\
    Complete output (27 lines):
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-3.8
    creating build\lib.win-amd64-3.8\Levenshtein
    copying Levenshtein\StringMatcher.py -> build\lib.win-amd64-3.8\Levenshtein
    copying Levenshtein\__init__.py -> build\lib.win-amd64-3.8\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.win-amd64-3.8\Levenshtein
    copying Levenshtein\_levenshtein.h -> build\lib.win-amd64-3.8\Levenshtein
    running build_ext
    building 'Levenshtein._levenshtein' extension
    error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\lenovo\\AppData\\Local\\Temp\\pip-install-uzcudq4o\\python-levenshtein\\setup.py'"'"'; __file__='"'"'C:\\Users\\lenovo\\AppData\\Local\\Temp\\pip-install-uzcudq4o\\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\lenovo\AppData\Local\Temp\pip-record-84ytnlqa\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\python38\Include\python-levenshtein' Check the logs for full command output.
iamnabink
  • 454
  • 9
  • 27
  • 2
    Different module, but same problem: https://stackoverflow.com/questions/29846087/microsoft-visual-c-14-0-is-required-unable-to-find-vcvarsall-bat Basically you can install build tools for Visual Studio https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2017 – Cory Kramer Jan 30 '20 at 12:21
  • 1
    The error message tells you exactly what to do in order to fix this problem – DeepSpace Jan 30 '20 at 12:24
  • 2
    What didn't work when you tried to install Microsoft Visual C++ 14.0? – Matthias Jan 30 '20 at 12:30
  • 1
    This is a pure Python Levenshtein implementation: https://pypi.org/project/pylev/ You don't need a compiler for pure Python packages. – phd Jan 30 '20 at 12:38
  • Thanks brother's , i solved it – iamnabink Jan 30 '20 at 12:43

0 Answers0