This code defines the services:
from nameko.rpc import rpc
class GreetingService:
name = "greeting_service"
@rpc
def hello(self, name):
return "Hello, {}!".format(name)
class MultiplyService:
name = "multiply_service"
@rpc
def multiple(self,a,b):
return str(int(a) * int(b))
I can open a nameko shell and access the microservice:

I want to access the microservice from another Python script. What am I missing?


The
nglobal is only available insidenameko shell.To invoke an RPC from a script, you need to use the one of the "standalone" clients in
nameko.standalone.rpc.Example in the docs here https://nameko.readthedocs.io/en/stable/built_in_extensions.html#rpc