在pythonanywhere.com上取消挑选的腌制对象

时间:2018-06-04 02:46:53

标签: python pickle

读取在python 3.6环境下保存的pickle文件的大量问题。 检查了stckoverflow上的其他类似问题 - 没有帮助

这是我们在python 3.6中保存文件的方式。

with open('sonde_adam_final.pkl', 'wb') as f:
    pickle.dump(sonde_data, f,protocol=2)

第一次我们尝试使用默认协议,默认为版本3,然后我们尝试了protocol = 2 - 仍然没有用。

这是我们尝试在python 3.6 env中打开的方式

sonde_data = pickle.load(open('sonde_adam_final.pkl', 'rb'), fix_imports=True, encoding='bytes')
Error: ModuleNotFoundError: No module named 'pandas.core.indexes'

sonde_data = pickle.loads(open('sonde_adam_final.pkl', 'rb'), fix_imports=True, encoding='bytes')
Error: TypeError: a bytes-like object is required, not '_io.BufferedReader'

sonde_data = pd.read_pickle(open('sonde_adam_final.pkl', 'rb''))

Error: TypeError: expected str, bytes or os.PathLike object, not _io.BufferedReader

sonde_data = pd.read_pickle('/home/vinorda/storm_predict/data/sonde_adam_final.pkl')

Error: ModuleNotFoundError: No module named 'pandas.core.indexes'

with open('/home/vinorda/storm_predict/data/sonde_adam_final.pkl', 'rb') as savefile:
    sonde_data = pd.read_pickle(savefile)

Error: TypeError: expected str, bytes or os.PathLike object, not _io.BufferedReader

with open('/home/vinorda/storm_predict/data/sonde_adam_final.pkl', 'rb') as savefile:
    sonde_data = pickle.load(savefile)

Error: ModuleNotFoundError: No module named 'pandas.core.indexes'

感谢任何帮助...

0 个答案:

没有答案