pip install scrapy를 하다가 마주친 빨간줄과 오류들.... 이 문제의 해결 방법을 간단히 정리하고자 한다.

문제

* error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/ *

 Building wheel for Twisted (setup.py) ... error
(중략)
    copying src\twisted\words\xish\xpathparser.g -> build\lib.win32-3.8\twisted\words\xish
    running build_ext
    building 'twisted.test.raiser' extension
    error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\hyunk\scrapy-projects\Scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\hyunk\\AppData\\Local\\Temp\\pip-install-3j2599mv\\Twisted\\setup.py'"'"'; __file__='"'"'C:\\Users\\hyunk\\AppData\\Local\\Temp\\pip-install-3j2599mv\\Twisted\\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\hyunk\AppData\Local\Temp\pip-record-pcewmclu\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\hyunk\scrapy-projects\include\site\python3.8\Twisted' Check the logs for full command output.

해결 방법

windows 10 64bit을 사용하고 있으므로 이에 맞는 Microsoft Visual C++ 14.0 환경을 구성해준다.

  1. https://visualstudio.microsoft.com/ko/vs/older-downloads/
  2. '재배포 가능 패키지 및 빌드 도구' 탭 클릭
  3. Microsoft Build Tools 2015 업데이트 3 '다운로드' 클릭
  4. 다운받은 인스톨러 설치

결과

설치 완료 후 다시 pip install scrapy을 해보면 패키지 설치가 성공됨을 알 수 있다.

Building wheels for collected packages: Twisted
  Building wheel for Twisted (setup.py) ... done
  Created wheel for Twisted: filename=Twisted-20.3.0-cp38-cp38-win32.whl size=3086623 sha256=708af701f60f0f36604fa89f9dd136ba5b35ac861e86f05edea3af6e44fe905c
  Stored in directory: c:\users\hyunk\appdata\local\pip\cache\wheels\f2\36\1b\99fe6d339e1559e421556c69ad7bc8c869145e86a756c403f4
Successfully built Twisted
Installing collected packages: cssselect, parsel, PyDispatcher, Twisted, pyOpenSSL, scrapy
Successfully installed PyDispatcher-2.0.5 Twisted-20.3.0 cssselect-1.1.0 parsel-1.6.0 pyOpenSSL-19.1.0 scrapy-2.1.0`

아래는 파이썬을 통해 scrapy 패키지를 불러온 결과이다.

(scrapy-projects) C:\Users\hyunk>python
Python 3.8.3 (tags/v3.8.3:6f8c832, May 13 2020, 22:20:19) [MSC v.1925 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import scrapy
>>> print('import 성공!')
import 성공!
>>>

'Python > 기본' 카테고리의 다른 글

Konlpy 설치 오류 해결법  (0) 2020.07.06

+ Recent posts