gpt4 book ai didi

python - Gevent:NotImplementedError

转载 作者:太空宇宙 更新时间:2023-11-04 10:42:42 25 4
gpt4 key购买 nike

为什么 gevent 会抛出这个错误?在 ipython、ubuntu 13 中运行它

In [1]: from gevent import monkey

In [2]: monkey.patch_all()

In [3]: The history saving thread hit an unexpected error (NotImplementedError('gevent is only usable from a single thread',)).History will not be written to the database.


In [3]:

最佳答案

ipython 使用一个单独的线程来保存命令历史。因为 gevent 修补了线程方法,所以预先存在的单独线程会触发 gevent 的“单线程”异常。

我不会在 ipython 中使用 gevent; ipython 与 gevent 兼容。

至少,尝试修补更少的东西;尝试 gevent.monkey.patch_all(thread=False) 看看 ipython 中的东西是否会中断。

关于python - Gevent:NotImplementedError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19571540/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com