【pytho】3以上版本使用pickle.load读取文件报UnicodeDecodeError: 'ascii' codec can't decode byte 0x8b in position 6

python 3以上版本使用pickle.load读取文件报UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xdb in position 2: ordinal not in range(128)
只需要在打开的时候指定编码: encoding='iso-8859-1’

import pickle
with open("factor_solve_data.pkl",'rb') as f:
	factor_data = pickle.load(f,encoding='iso-8859-1')

你可能感兴趣的:(python)