{"id":10021170,"date":"2026-01-06T23:42:02","date_gmt":"2026-01-06T15:42:02","guid":{"rendered":"https:\/\/itmax.cn\/?p=10021170"},"modified":"2026-01-06T23:42:02","modified_gmt":"2026-01-06T15:42:02","slug":"nameko-%e6%97%a0%e6%b3%95%e9%80%82%e9%85%8d%e6%96%b0%e7%89%88%e7%9a%84python3-14%ef%bc%8ceventlet-%e5%81%9c%e6%ad%a2%e7%bb%b4%e6%8a%a4%e5%af%bc%e8%87%b4%e7%9a%84%e5%a4%b1%e6%95%88","status":"publish","type":"post","link":"https:\/\/itmax.cn\/?p=10021170","title":{"rendered":"nameko \u65e0\u6cd5\u9002\u914d\u65b0\u7248\u7684python3.14\uff0ceventlet \u505c\u6b62\u7ef4\u62a4\u5bfc\u81f4\u7684\u5931\u6548"},"content":{"rendered":"<p>nameko \u65e0\u6cd5\u9002\u914d\u65b0\u7248\u7684python3.14\uff0ceventlet \u505c\u6b62\u7ef4\u62a4\u5bfc\u81f4\u7684 1 RLock(s) were not greened \u62a5\u9519<\/p>\n<hr>\n<p>\u7528\u4e8e\u6d4b\u8bd5\u7684\u4ee3\u7801<\/p>\n<pre><code class=\"python\">from nameko.rpc import rpc\n\nclass HelloService:\n    name = &quot;hello_service&quot;\n\n    @rpc\n    def hello(self, name):\n        return &quot;Hello, {}!&quot;.format(name)<\/code><\/pre>\n<p>\u76f4\u63a5\u628a nameko2.14.1 \u7528\u5230 python3.14 \u4e0a\u4f1a\u62a5\u9519 <code>ModuleNotFoundError: No module named 'pkg_resources'<\/code><\/p>\n<p>\u4fee\u590d\u4e4b\u540e\u8fd8\u662f\u4f1a\u6709\u8b66\u544a<\/p>\n<pre><code class=\"shell\">\u2570\u2500\u27a4  nameko run --config config.yaml run_services\n1 RLock(s) were not greened, to fix this error make sure you run eventlet.monkey_patch() before importing any other modules.\nstarting services: greeting_service\nConnected to amqp:\/\/ponponon:**@192.168.31.245:5672\/\/<\/code><\/pre>\n<p>\u8fd9\u4e2a <code>1 RLock(s) were not greened<\/code> \u4e0d\u662f\u56e0\u4e3a nameko \u7684\u95ee\u9898\uff0c\u800c\u662f\u6765\u81ea eventlet \u672c\u8eab\u7684\u95ee\u9898\uff1a<a href=\"https:\/\/link.segmentfault.com\/?enc=E1ZwectwFXAuDGudZ7slcQ%3D%3D.FME8Kb%2FRYuc5xuQEOybZ5uXRFWNVMM10niuKKzfA5JKvDYzuu6mN9tYKXq37AVq0\" rel=\"nofollow noopener noreferrer\" target=\"_blank\">https:\/\/github.com\/eventlet\/eventlet<\/a><\/p>\n<p>\u6211\u901a\u8fc7\u964d\u4f4e cpython \u7248\u672c\u505a\u6d4b\u8bd5\uff0c\u53d1\u73b0 cpython3.13 \u4e5f\u6709\u8fd9\u4e2a\u95ee\u9898\uff1b\u76f4\u5230\u964d\u7ea7\u5230 cpython3.12 \u5219\u6ca1\u6709\u8fd9\u4e2a\u95ee\u9898\u4e86<\/p>\n<p>\u800c\u5927\u4e8e 3.12 \u7684\u7248\u672c\u5c31\u4f1a\u9047\u5230\u4e0b\u9762\u7684\u95ee\u9898<\/p>\n<pre><code class=\"shell\">\u2570\u2500\u27a4  ipython                                                                     1 \u21b5\nPython 3.14.2 (main, Dec  5 2025, 16:49:16) [Clang 17.0.0 (clang-1700.4.4.1)]\nType 'copyright', 'credits' or 'license' for more information\nIPython 9.9.0 -- An enhanced Interactive Python. Type '?' for help.\nTip: Use `object?` to see the help on `object`, `object??` to view its source\nCmd click to launch VS Code Native REPL\n\nIn [1]: exec('import eventlet; eventlet.monkey_patch()')\n&lt;string&gt;:1: DeprecationWarning: \nEventlet is deprecated. It is currently being maintained in bugfix mode, and\nwe strongly recommend against using it for new projects.\n\nIf you are already using Eventlet, we recommend migrating to a different\nframework.  For more detail see\nhttps:\/\/eventlet.readthedocs.io\/en\/latest\/asyncio\/migration.html\n\n1 RLock(s) were not greened, to fix this error make sure you run eventlet.monkey_patch() before importing any other modules.<\/code><\/pre>\n<p><a href=\"https:\/\/segmentfault.com\/a\/1190000047525496\">https:\/\/segmentfault.com\/a\/1190000047525496<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>nameko \u65e0\u6cd5\u9002\u914d\u65b0\u7248\u7684python3.14\uff0ceventlet \u505c\u6b62\u7ef4\u62a4\u5bfc\u81f4\u7684 1 RLock(s) we [&hellip;]<\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4],"tags":[],"class_list":["post-10021170","post","type-post","status-publish","format-standard","hentry","category-share"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts\/10021170","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10021170"}],"version-history":[{"count":0,"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts\/10021170\/revisions"}],"wp:attachment":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10021170"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10021170"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10021170"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}