我正在使用命令行使用pip 20.0.2安装python(v-3.8.1)软件包,但无法安装python-Levenshtein
软件包。
尝试此命令时:
pip install python-levenshtein
给我这个错误
错误:命令错误,退出状态为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'“'”'; 文件 ='“'”'C:\ Users \ lenovo \ AppData \ Local \ Temp \ pip-install-uzcudq4o \ python-levenshtein \ setup.py'“'”'; f = getattr(标记化, '“'”'open'“'”',打开)(文件); code = f.read()。replace('“ '“'”'\\ n'“'”'); f.close(); exec(compile(code, file ,'“'”'exec'“'”')))' 安装-记录 'C:\ Users \ lenovo \ AppData \ Local \ Temp \ pip-record-84ytnlqa \ install-record.txt' --single-version-externally-managed --compile --install-headers'c:\ python38 \ Include \ python-levenshtein'
完整输出:
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.