【发布时间】:2020-05-29 17:35:38
【问题描述】:
我正在研究 Jupyter 并试图使我的列表持久化,但酸洗只会给我这个错误:
PicklingError Traceback (most recent call last)
<ipython-input-34-3ba985598f1e> in <module>
1 with open("book_data/books.pkl", "wb") as cf:
----> 2 pickle.dump(book_list, cf)
PicklingError: Can't pickle <class '__main__.book'>: it's not the same object as __main__.book
我尝试使用 dill 来保存会话,但它给了我这个错误:
RecursionError Traceback (most recent call last)
<ipython-input-33-5011bc09ef45> in <module>
1 import dill
----> 2 dill.dump_session('Data_Gathering.db')
【问题讨论】:
标签: python-3.x jupyter-notebook persistence pickle dill