BeautifulSoup 설치 에러

2019. 9. 19. 16:58프로그래밍/에러

  

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
  ERROR: Command errored out with exit status 1:
     command: /usr/local/bin/python3.7 -'import sys, setuptools, tokenize; sys.argv[0] = '"
'"'/tmp/pip-install-j9kd57oq/BeautifulSoup/setup.py'"'"'; __file__='"'"'/tmp/pip-install-j9kd
57oq/BeautifulSoup/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.r
ead().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'
"'"'))' egg_info --egg-base pip-egg-info
         cwd: /tmp/pip-install-j9kd57oq/BeautifulSoup/
    Complete output (6 lines):
    Traceback (most recent call last):
      File "", line 1in 
      File "/tmp/pip-install-j9kd57oq/BeautifulSoup/setup.py", line 22
        print "Unit tests have failed!"
                                      ^
    SyntaxError: Missing parentheses in call to 'print'. Did you mean print("Unit tests have
failed!")?
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for fu
ll command output.
cs

pip를 사용해서 BeautifulSoup를 설치하다 보면, 이런 에러를 마주할 때가 있다. 

이럴 땐 일단 python 버전을 확인해보자. 

 
1
python --version
cs

여기서 3.7 이상의 버전이라고 나올 경우, BeautifulSoup4를 설치해주어야 한다.

1
pip install BeautifulSoup4
cs

 

세줄 요약

1. BeautifulSoup 설치하는데 위와 같은 오류 발생

2. 파이썬 버전 확인해보고,

3. 3.7 버전이라면 BeautifulSoup4를 설치해준다.