I am trying jsonrpc2 using python. I created a file hello.py
def greeting(name):
return dict(message="Hello, %s!" % name)
Then I run
runjsonrpc2 hello
but i got
ImportError: No module named hello
I am trying jsonrpc2 using python. I created a file hello.py
def greeting(name):
return dict(message="Hello, %s!" % name)
Then I run
runjsonrpc2 hello
but i got
ImportError: No module named hello
It seems that runjsonrpc2
is not able to find the hello.py
module in the sys.path
.
You can augment the search path including the directory where your hello
module lays just setting the PYTHONPATH environment variable.
For example, if you are using a bash shell, you can run the following commands in the same directory of your hello.py
file:
$ export PYTHONPATH=$PYTHONPATH:.
$ runjsonrpc2 hello