Dill TypeError:无法腌制 'sqlite3.Connection“对象。函数中的任何位置都没有 Sqlite

Dill TypeError: cannot pickle 'sqlite3.Connection' object. No Sqlite anywhere in function

提问人:skrhee 提问时间:10/22/2021 最后编辑:skrhee 更新时间:10/22/2021 访问量:775

问:

我收到 TypeError: cannot pickle 'sqlite3.Connection“对象。问题是,我没有在我的项目中的任何地方使用sqlite,在这个函数中绝对没有使用。

下面是一个显示错误的最小工作示例:

    def test_outer(a):
        def test_inner(a):
            return a+1
        return a
    dill.dumps(test_outer)
SQLite Pickle 多进程 莳萝

评论

0赞 Mike McKerns 10/22/2021
让我们在这里解决这个问题:github.com/uqfoundation/dill/issues/435。从本质上讲,这段确切的代码在莳萝测试中运行,并且适用于所有版本的 python......所以我希望它必须是你环境中的东西。
0赞 Alex Deft 2/10/2022
您是否在 Pycharm 的 pyconsole 中运行了这个?

答: 暂无答案