Closed Coinomatron closed 5 years ago
AFAIK the path shouldn't matter.
Have you installed pylightning? It contains the module that the error highlights.
You may install it with
pip install pylightning
or see pylightning
@Coinomatron
You can also set the PYTHONPATH environment variable, as the source comes with the pyligthning in contrib folder
PYTHONPATH=/hoe/user/lnrepo/contrib/pythonpath:$PYTHONPATH /hoe/user/lnrepo/lightningd/lightningd --plugin=...
pip install did the trick. @m-schmoock is that command meant for the lightningd start up flags?
@Coinomatron When you have the sources of c-lightningd and compiled it, the thing you installed with pip
is already on your harddrive (./contrib/pylightning
). You can tell python to use this with the PYTHONPATH
evnironment variable. pip
makes sure a pylightning version is in your PYTHONPATH, but it may be a different version.
Writing the environment variable before the command actually sets the variable for the next command only, kind of a startup flag if you want :D
Yes, I figured that much. I'd rather have done that, but I couldn't figure out this line.
PYTHONPATH=/home/user/lnrepo/contrib/pythonpath:$PYTHONPATH /hoe/user/lnrepo/lightningd/lightningd --plugin=...
In my case, that would be
PYTHONPATH=/home/user/lightning/contrib/pylightning:$PYTHONPATH /home/user/lightning/contrib/pylightning
?
@Coinomatron For your example paths this would be:
PYTHONPATH=/home/user/lightning/contrib/pylightning:$PYTHONPATH /home/user/lightning/lightningd/lightningd --plugin=...
File "/home/user/lightning/plugins/plugins/rebalance/rebalance.py", line 2, in
from lightning import Plugin, Millisatoshi, RpcError
ModuleNotFoundError: No module named 'lightning'
Does it matter where the plugin is located?