python - language_tool_python - 类型错误:无法腌制 _thread.lock 对象
问题描述
试图腌制 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
解决方案
推荐阅读
- reactjs - 如何在 react-leaflet 中使用 setRotationAngle
- internet-explorer - X-UA 兼容 IE=10 不能在 EDGE 上运行
- c++ - linux“重命名”函数调用是否阻塞直到复制(当源和目标在不同磁盘中时)完成
- jquery - 用于 jquery .load() 的 BeforeSend
- json - 当我将以下脚本与 selenium 和 Beautifulsoup 一起使用时,文本被正确提取,但 json 文件始终相同
- angular - 在 ng2-charts 中定义工具提示的新位置
- android - 无法从 CursorWindow 读取行。从图库中旋转图像时出错
- c# - UWP/C# 报告生成
- javascript - 如何将 IONIC1 项目升级到 IONIC3 项目?
- blazor - 找不到 Blazor client.dll 404