[pip install]distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
안녕하세요 이번 포스팅은 pip를 설치하면서 발생하는 에러를 해결하는 방법에 대해서 알아보겠습니다.
개발 환경
- OS: Windows 10
- python: Python 3.8.0
- pip: pip 19.3.1
저는 아래 두 개 라이브러리를 설치하면서 위와 같은 에러가 발생했습니다.
pip install tensor2tensor
pip install konlpy
참고로 첫 번째 라이브러리는 transformer 모델을 설치하는 명령어이고 두 번째는 형태소 분석을 위한 라이브러 입니다.
[Error Message]
ERROR: Command errored out with exit status 1:
command: 'c:\users\ynebu\appdata\local\programs\python\python38\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Public\\Documents\\ESTsoft\\CreatorTemp\\pip-install-b27rktjo\\gevent\\setup.py'"'"'; __file__='"'"'C:\\Users\\Public\\Documents\\ESTsoft\\CreatorTemp\\pip-install-b27rktjo\\gevent\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\Public\Documents\ESTsoft\CreatorTemp\pip-install-b27rktjo\gevent\pip-egg-info'
cwd: C:\Users\Public\Documents\ESTsoft\CreatorTemp\pip-install-b27rktjo\gevent\
Complete output (113 lines):
Traceback (most recent call last):
File "c:\users\ynebu\appdata\local\programs\python\python38\lib\site-packages\setuptools\msvc.py", line 489, in _find_latest_available_vc_ver
return self.find_available_vc_vers()[-1]
IndexError: list index out of range
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\users\ynebu\appdata\local\programs\python\python38\lib\site-packages\setuptools\sandbox.py", line 154, in save_modules
yield saved
File "c:\users\ynebu\appdata\local\programs\python\python38\lib\site-packages\setuptools\sandbox.py", line 195, in setup_context
yield
File "c:\users\ynebu\appdata\local\programs\python\python38\lib\site-packages\setuptools\sandbox.py", line 250, in run_setup
_execfile(setup_script, ns)
File "c:\users\ynebu\appdata\local\programs\python\python38\lib\site-packages\setuptools\sandbox.py", line 45, in _execfile
exec(code, globals, locals)
File "C:\Users\Public\Documents\ESTsoft\CreatorTemp\easy_install-lolgdivb\cffi-1.13.2\setup.py", line 127, in
HUB_PRIMITIVES = Extension(name="gevent.__hub_primitives",
File "C:\Users\Public\Documents\ESTsoft\CreatorTemp\easy_install-lolgdivb\cffi-1.13.2\setup.py", line 105, in uses_msvc
include_dirs=include_dirs)
File "c:\users\ynebu\appdata\local\programs\python\python38\lib\distutils\command\config.py", line 225, in try_compile
self._compile(body, headers, include_dirs, lang)
File "c:\users\ynebu\appdata\local\programs\python\python38\lib\distutils\command\config.py", line 132, in _compile
self.compiler.compile([src], include_dirs=include_dirs)
File "c:\users\ynebu\appdata\local\programs\python\python38\lib\distutils\_msvccompiler.py", line 360, in compile
self.initialize()
File "c:\users\ynebu\appdata\local\programs\python\python38\lib\distutils\_msvccompiler.py", line 253, in initialize
vc_env = _get_vc_env(plat_spec)
File "c:\users\ynebu\appdata\local\programs\python\python38\lib\site-packages\setuptools\msvc.py", line 185, in msvc14_get_vc_env
return EnvironmentInfo(plat_spec, vc_min_ver=14.0).return_env()
File "c:\users\ynebu\appdata\local\programs\python\python38\lib\site-packages\setuptools\msvc.py", line 843, in __init__
self.si = SystemInfo(self.ri, vc_ver)
File "c:\users\ynebu\appdata\local\programs\python\python38\lib\site-packages\setuptools\msvc.py", line 485, in __init__
self.vc_ver = vc_ver or self._find_latest_available_vc_ver()
File "c:\users\ynebu\appdata\local\programs\python\python38\lib\site-packages\setuptools\msvc.py", line 492, in _find_latest_available_vc_ver
raise distutils.errors.DistutilsPlatformError(err)
distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/[Resolve]
에러 메시지에서 가이드 해줬듯이 visualstudio를 다운받아서 설치하셔야 합니다.
https://visualstudio.microsoft.com/downloads/
위 사이트에 접속하시면 세 개의 다운로드할 수 있습니다. Community를 다운 받으시길 바랍니다.

다운로드가 완료되면 설치할 워크로드를 선택하는 화면이 나타납니다. pip와 관련된 항목인 "C++를 사용한 데스크톱 개발"을 선택하고 설치합니다.

비고) 저는 처음 설치할 때는 다운로드를 완료하고 설치하는데 오랜 걸리고 설치가 안돼서 컴퓨터를 리붓 후 다시 했습니다.
pip install 명령어를 다시 수행하시면 라이브러리가 설치하시면 정상적으로 설치됨을 확인할 수 있습니다.
감사합니다.
댓글
댓글 쓰기