Traceback (most recent call last):
File "/anaconda3/workspace_data/emoji_data/data/PsychExp/load_pk_file.py", line 27, in <module>
datas = loadList(path)
File "/anaconda3/workspace_data/emoji_data/data/PsychExp/load_pk_file.py", line 17, in loadList
segContent = pickle.load(pkl_file)
File "/anaconda3/lib/python3.7/pickle.py", line 1593, in _load
encoding=encoding, errors=errors).load()
File "/anaconda3/lib/python3.7/pickle.py", line 1085, in load
dispatch[key[0]](self)
File "/anaconda3/lib/python3.7/pickle.py", line 1210, in load_string
self.append(self._decode_string(codecs.escape_decode(data)[0]))
File "/anaconda3/lib/python3.7/pickle.py", line 1201, in _decode_string
return value.decode(self.encoding, self.errors)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xf0 in position 6: ordinal not in range(128)

def loadList(path):
pkl_file = open(path, ‘rb’)
segContent = pickle.load(pkl_file)
pkl_file.close()
return segContent
将上述代码中的 segContent = pickle.load(pkl_file)
更改为segContent = pickle.load(pkl_file, encoding='bytes')
参考:https://blog.csdn.net/qq_41185868/article/details/79039604
来源:CSDN
作者:wanzi_antang
链接:https://blog.csdn.net/wanzi_antang/article/details/103734394