Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simplify HWI install instructions #1317

Open
ZZiigguurraatt opened this issue Jan 23, 2025 · 3 comments
Open

simplify HWI install instructions #1317

ZZiigguurraatt opened this issue Jan 23, 2025 · 3 comments
Assignees

Comments

@ZZiigguurraatt
Copy link

I'd suggest replacing

$ git clone --branch tapd-v0.6.0-cold-minting https://github.com/lightninglabs/HWI.git
$ cd HWI
```
Depending on your environment, you need to install the Python dependencies of
the HWI application:
```shell
$ python3 setup.py install # or 'poetry install' or 'pip3 install .'
```

with

pip3 install git+https://github.com/lightninglabs/[email protected]

This will then install to

~/.local/bin/hwi

without leaving a residual clone of the repository lying around.

Also, if ~/.local/bin is in your path (most systems it is, but you might have to log out and back in if pip just created ~/.local/bin so that it will be picked up because it isn't added to the PATH if it doesn't exist when you log in) , the following commands can be simplified from

$ ./hwi.py

to

$ hwi
.

@gijswijs
Copy link
Contributor

That's a great suggestion. I would like to add that in newer versions of Linux (e.g. Ubuntu 23.04 or later but other distros will likely have this issue as well) this doesn't work due to PEP 668.

By the way this issue arises with both your suggestion and the original install instructions.

So to incorporate both your improvement and a workaround for newer versions of Linux, I'd suggest the following:

`pip3 install git+https://github.com/lightninglabs/[email protected]`

On newer versions of Linux this might throw an error stating `externally-managed-environment`, if so either use

`pip3 install git+https://github.com/lightninglabs/[email protected] --break-system-packages`

or

`pipx install git+https://github.com/lightninglabs/[email protected]`

@gijswijs gijswijs self-assigned this Jan 23, 2025
@ZZiigguurraatt
Copy link
Author

Interesting, not heard of pipx. So does it automatically create a separate virtualenv for each package installed?

Also, does the --user option for pip3 help at all? I have only run ubuntu 24.04 in docker as root and not on a desktop as a normal user, so I'm wondering if that might be better than --break-system-packages?

@gijswijs
Copy link
Contributor

Yeah, pipx is made specifically for application installation. It automatically creates a virtual environment, installs the package, and adds the package's associated applications (entry points) to a location on your PATH.

Also, does the --user option for pip3 help at all?

No, it does not. I just tested it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🆕 New
Development

No branches or pull requests

2 participants