lnet icon indicating copy to clipboard operation
lnet copied to clipboard

How to build / run lnet without pip3 install?

Open s-tikhomirov opened this issue 6 years ago • 6 comments

I want to experiment with this tool and modify it. How do I run it from source, not via pip3 install?

s-tikhomirov avatar May 15 '19 13:05 s-tikhomirov

git clone [email protected]:cdecker/lnet.git
cd lnet/
virtualenv -p (which python3) venv
./venv/bin/pip install -r requirements.txt
./venv/bin/pip install requests
./venv/bin/pip install --editable .
./venv/bin/lnet-cli

Or instead of always typing the ./venv/bin/ prefix you could call source venv/bin/activate (on bash) and call pip, python and lnet-cli/lnet-daemon directly.

fiatjaf avatar May 15 '19 14:05 fiatjaf

Might be a typo in virtualenv -p (which python3) venv, as it gives me bash: syntax error near unexpected token `('. Works if I copy the path returned by which python3 manually though.

Installed this way, ln-cli works (well, modulo #4), but how do I recompile the code? I included print("foo") right after print("Starting") in web.py, ran ./venv/bin/pip install --editable . once again, and launched ln-cli, but foo wasn't printed.

s-tikhomirov avatar May 15 '19 15:05 s-tikhomirov

(Sorry, I forgot I was using fish syntax for the (which) thing.)

The --editable flag was supposed to just create symlinks so you could edit the source and it would be reflected in the executables without having to install again or do anything. But even if it fails, installing again should yield you the correct results.

I've tested it by adding a print('aaa') statement at the beginning of bin/lnet-cli file and it worked. I don't understand why it isn't working for you.

fiatjaf avatar May 15 '19 15:05 fiatjaf

Ok, I was confusing two copies of lncli on my machine; now when I have only one, adding print("aaa") to bin/lnet-cli achieves the expected result. However, modifying lnet/web.py doesn't...

s-tikhomirov avatar May 15 '19 15:05 s-tikhomirov

Where did you add the print statement, and how are you starting the script?

cdecker avatar Jul 18 '19 16:07 cdecker

I can't get the example graph to run from the repo. Setup:

python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
pip install requests
pip install --editable .

Run lnet-daemon and lnet-cli start <file-containing-graph-from-readme>. Daemon logs:

Starting graph
Starting
Starting server

Seems to get stuck here

justinmoon avatar Oct 07 '19 05:10 justinmoon