개발일기 정답찾기

[파이썬] SyntaxError Non-UTF-8 code starting with '\xea' in file 에러 해결 본문

IT/python

[파이썬] SyntaxError Non-UTF-8 code starting with '\xea' in file 에러 해결

유딩동 2021. 6. 19. 13:31

안녕하세요 유딩동입니다.

파이썬 BeautifulSoup 예제를 실행하다가 다음과 같은 에러가 뜨는 상황이 발생하였습니다.

 

SyntaxError: Non-UTF-8 code starting with '\xea' in file C:\python_ws\bsTest.py on line 183, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

Process finished with exit code 1

 

해결방법 맨위에 다음 코드를 삽입해줍니다.

# -*- coding: cp949 -*-

정상 작동 합니다. :D

'IT > python' 카테고리의 다른 글

[파이썬] py exe 변환 pyinstaller 실행파일(.exe) 만들기  (0) 2021.06.10
Comments