在使用python的pyhanlp模块时,历尽千辛安装好,调用时候又被报错编码问题
下面是报错内容
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
from pyhanlp import HanLP
File "D:\Python\lib\site-packages\pyhanlp\__init__.py", line 33, in <module>
from pyhanlp.static import STATIC_ROOT
File "D:\Python\lib\site-packages\pyhanlp\static\__init__.py", line 273, in <module>
if not hanlp_installed_data_path():
File "D:\Python\lib\site-packages\pyhanlp\static\__init__.py", line 112, in hanlp_installed_data_path
root = read_config()
File "D:\Python\lib\site-packages\pyhanlp\static\__init__.py", line 245, in read_config
for line in f:
UnicodeDecodeError: 'gbk' codec can't decode byte 0xac in position 3: illegal multibyte sequence
尝试过更改全局编码,改变文件编码都不行,init.py没敢改
init.py里面代码的编码也是‘utf-8’,乍一看没问题
整了三天了,没找到办法,希望可以帮忙看看