在GoogleColab

问题描述 投票:0回答:1
似乎正在使用Gevent Monkey-Patching。 请设置一个环境变量:

gevent_support =true

在调试器中启用Gevent支持。

看着,我发现唯一建议的解决方案是

import os; os.environ["GEVENT_SUPPORT"] = "True"

,但是,此解决方案不起作用。有人找到了这个问题的解决方法吗?

我的代码:

from gevent import monkey
monkey.patch_all(thread=False, select=False)

import grequests

I通过删除和导入模块解决了此问题。

Import:

python-3.x jupyter-notebook google-colaboratory gevent grequests
1个回答
2
投票

import grequests

  1. 泄漏:
import sys

del sys.modules["grequests"] 
del grequests
del sys.modules["gevent.monkey"] 
再次IMPORT:
  1. import grequests
我不知道这是否会破坏任何东西,因为删除库是一个不好的选择,但是它帮助了消息,并且对我有用。
	
最新问题
© www.soinside.com 2019 - 2025. All rights reserved.