跳至正文
-
关注
IT极限技术分享汇

ITmax

IT极限技术分享汇

ITmax

  • 首页
  • 商店
  • 我的帐户
  • 结账
  • 购物车
  • 首页
  • 商店
  • 我的帐户
  • 结账
  • 购物车
关

搜索

技术分享

nameko 无法适配新版的python3.14,eventlet 停止维护导致的失效

作者 aigc
2026年1月6日 1 分钟阅读
0

nameko 无法适配新版的python3.14,eventlet 停止维护导致的 1 RLock(s) were not greened 报错


用于测试的代码

from nameko.rpc import rpc

class HelloService:
    name = "hello_service"

    @rpc
    def hello(self, name):
        return "Hello, {}!".format(name)

直接把 nameko2.14.1 用到 python3.14 上会报错 ModuleNotFoundError: No module named 'pkg_resources'

修复之后还是会有警告

╰─➤  nameko run --config config.yaml run_services
1 RLock(s) were not greened, to fix this error make sure you run eventlet.monkey_patch() before importing any other modules.
starting services: greeting_service
Connected to amqp://ponponon:**@192.168.31.245:5672//

这个 1 RLock(s) were not greened 不是因为 nameko 的问题,而是来自 eventlet 本身的问题:https://github.com/eventlet/eventlet

我通过降低 cpython 版本做测试,发现 cpython3.13 也有这个问题;直到降级到 cpython3.12 则没有这个问题了

而大于 3.12 的版本就会遇到下面的问题

╰─➤  ipython                                                                     1 ↵
Python 3.14.2 (main, Dec  5 2025, 16:49:16) [Clang 17.0.0 (clang-1700.4.4.1)]
Type 'copyright', 'credits' or 'license' for more information
IPython 9.9.0 -- An enhanced Interactive Python. Type '?' for help.
Tip: Use `object?` to see the help on `object`, `object??` to view its source
Cmd click to launch VS Code Native REPL

In [1]: exec('import eventlet; eventlet.monkey_patch()')
<string>:1: DeprecationWarning: 
Eventlet is deprecated. It is currently being maintained in bugfix mode, and
we strongly recommend against using it for new projects.

If you are already using Eventlet, we recommend migrating to a different
framework.  For more detail see
https://eventlet.readthedocs.io/en/latest/asyncio/migration.html

1 RLock(s) were not greened, to fix this error make sure you run eventlet.monkey_patch() before importing any other modules.

https://segmentfault.com/a/1190000047525496

作者

aigc

关注我
其他文章
上一个

时代的眼泪,nameko 和 eventlet 停止维护后的项目自救,升级和替代之路

下一个

Linux再添一员猛将,操作完全不输Windows!

暂无评论!成为第一个。

发表回复 取消回复

您的邮箱地址不会被公开。 必填项已用 * 标注

Copyright 2026 — IT极限技术分享汇. 备案号:浙ICP备17006560号-2