Install & Compatibility
Where this runs
tested against v2.14.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 1.000s · 43.4MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 4.5s · import 0.918s · 41MB
41MB installed
● package 41MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
ServiceBase
✓ from nameko.rpc import rpc
Nameko uses decorators, not base classes. Use @rpc on methods.
nameko run
✓ from nameko.cli.main import main
✗ from nameko.runner import run
In v2.x, use nameko CLI command. For programmatic usage, use ServiceRunner.
Define a simple RPC service and run it using the nameko CLI.
from nameko.rpc import rpc
from nameko.standalone.rpc import ServiceRpcProxy
class GreetingService:
name = 'greeting_service'
@rpc
def hello(self, name):
return f'Hello, {name}!'
if __name__ == '__main__':
from nameko.runners import ServiceRunner
from nameko.containers import ServiceContainer
from nameko.cli.main import run
# Run with: nameko run service:GreetingService
print('Run with: nameko run <module>:GreetingService')
nameko --version
Debug
Known issues
breakingIn v2.x, nameko automatically patches eventlet. In v3.x, this is removed and must be done manually.fixIf upgrading to v3.x, ensure your code does not rely on automatic monkey-patching. Import eventlet and call eventlet.monkey_patch() if needed.
affects: <3.0.0 vs >=3.0.0-rc9
gotchaAsync RPC calls: using ServiceRpcProxy in an async context can cause deadlocks if not handled correctly.fixUse ServiceRpcProxy in synchronous code only, or use nameko's async extensions if available.
affects: all
deprecatednameko backdoor command was removed in v3.0.0-rc7.fixUse alternative debugging methods such as pdb or remote debugging.
affects: >=3.0.0-rc7
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'nameko'
Nameko not installed or running in wrong environment.
pika.exceptions.AMQPConnectionError: Connection closed by remote server
RabbitMQ not running or unreachable.
fixEnsure RabbitMQ is running and accessible. Check AMQP_URI config.
AttributeError: module 'nameko' has no attribute 'rpc'
Incorrect import path. Use 'from nameko.rpc import rpc'.
fixCorrect import: from nameko.rpc import rpc
Upgrade
Version history
2.14.1latest on PyPI · released Dec 5, 2021
Audit
Dependencies
eventletoptionalNameko v2.x automatically monkey-patches with eventlet. In v3.x, this is opt-in.
rabbitmqrequiredRequired as an external messaging broker for RPC and events.