SyntaxError: Non-UTF-8 code starting with ‘\xe5‘ in file
SyntaxError: Non-UTF-8 code starting with '\xe5' in file
- 1、问题描述
- 2、解决方法
1、问题描述
- SyntaxError: Non-UTF-8 code starting with ‘\xe5’ in file
- 该问题是由于代码中的中文没有指定编码方式。
SyntaxError: Non-UTF-8 code starting with '\xe5' in file D:\AI\projects\crawl4ai\code\crawl4ai_baike.py on line 72, but no encoding declared; see https://python.org/dev/peps/pep-0263/ for details
2、解决方法
代码第一行 加入下面一行内容
# -*- coding: utf-8 -*-