python gevent异常:MonkeyPatchWarning: Monkey-patching ssl after ssl has already been imported may lead to errors

python gevent异常:MonkeyPatchWarning: Monkey-patching ssl after ssl has already been imported may lead to errors

异常:

python gevent魔法补丁出现错误提示:MonkeyPatchWarning: Monkey-patching ssl after ssl has already been imported may lead to errors, including RecursionError

原因:

import包名顺序导入错误,使用gevent,务必将import gevent,from gevent import monkey,monkey.patch_all()三行语句放在其他所有的import语句之前

例子: