I think you need to use dill for this purpose.
"dill
extends python’s pickle
module for serializing and de-serializing python objects to the majority of the built-in python types. Serialization is the process of converting an object to a byte stream, and the inverse of which is converting a byte stream back to on python object hierarchy."
conda install -c anaconda dill
To save the Jupyter Notebook session:
import dill
dill.dump_session('notebook_session.db')
To restore the session:
import dill
dill.load_session('notebook_session.db')