0

I have an import error with

from psycogreen.gevent import psyco_gevent
psyco_gevent.make_psycopg_green()

it says:

ImportError: cannot import name psyco_gevent

I installed psycopg2 and psycogreen; and I followed this nice article about Django, Gevent, and Socket.io. This article also talks about it (it might be the source of the first article) and talks about a file named psyco_gevent.py on bitbucket which is not available anymore (404 error).

4

2 回答 2

1

对于 psycogreen 来说,它看起来确实发生了一些变化。在 bitbucket 上查看: https ://bitbucket.org/dvarrazzo/psycogreen/overview

它看起来像这样的代码:

from psycogreen.gevent import psyco_gevent
psyco_gevent.make_psycopg_green()

应更改为与其他 psycogreen 调用相同:

from psycogreen.gevent import patch_psycopg
patch_psycopg()
于 2014-12-03T10:49:51.733 回答
0

当我导入名为的模型时,我遇到了类似的问题greenlet

ImportError:无法导入名称“greenlet”

我不知道确切的原因,但我通过将文件名重命名greenlet.pygl.py. 也许我们不能用模型的名字来命名文件。

于 2018-09-26T10:01:24.073 回答