试图腌制 language_tool_python.LanguageTool('en-US') 的 language_tool_python 模块。如何解决以下问题?
import language_tool_python
import pickle
tool = language_tool_python.LanguageTool('en-US')
with open("lang_tool_pickle", "wb") as file:
pickle.dump(tool, file)
这给出了以下错误:
TypeError Traceback (most recent call last)
<ipython-input-27-caf8effcda8a> in <module>()
1 with open("lang_tool_pickle", "wb") as file:
----> 2 pickle.dump(tool, file)
TypeError: can't pickle _thread.lock objects