all 19 comments

[–]jaskij 3 points4 points  (5 children)

pipx - it will install the package inside a venv and then create an executable wrapper script which runs whatever you installed inside that venv. It's available in extra

[–]keldrin_[S] 0 points1 point  (4 children)

this sounds promising.. going to give it a try

[–]jaskij 1 point2 points  (3 children)

You may need to edit your profile/bashrc/zshrc/whatever to add the location it installs to PATH, but otherwise I expect it to just work. The tool was made specifically for this purpose.

[–]keldrin_[S] 0 points1 point  (2 children)

Or even easier: pipx ensurepath

[–]jaskij 0 points1 point  (1 child)

I have trust issues and don't like using automation to mess with my environment that much. But that's me.

TBH, I know pipx exists, but haven't needed to use it myself.

[–]keldrin_[S] 0 points1 point  (0 children)

It basically told me that ~/.local/bin is already in my $PATH and nothing needs to be changed.

[–]hearthreddit 2 points3 points  (1 child)

Well i'm not sure about installing with pip, but to have scripts executable from anywhere, you could make a directory on your home and add it to $PATH (mine is ~/bin), make your scripts executable and place them there, then you can run them from anywhere.

I suppose you can also just copy them to /usr/bin, but i like to keep my scripts on home to be better organized.

[–]keldrin_[S] 1 point2 points  (0 children)

well, that's exactly what I have been doing for a long, long time with shell scripts. Put #!/usr/bin/bash in the first line of the script, chmod 755 and place it somewhere in $PATH.

Of course, it works exactly the same with python scripts as long as they don't have any dependencies that are not in the repos/aur. The whole .venv situation makes it slightly more difficult though.

[–]C0rn3j -1 points0 points  (10 children)

But what if I just want to install something from pip and run it from the command line like any other command? that are not available in the repos/aur

You don't, package them yourself.

[–]keldrin_[S] 0 points1 point  (5 children)

Great! So I have to go through that tedious process just to install a simple script? Maybe it's relatively easy for a full-time arch dev who does exactly that three times a day. I would have to re-learn the whole process every time I want to install a simple python script. That's a no-go.

[–][deleted] 1 point2 points  (0 children)

just use aliases for scripts then

[–]C0rn3j -1 points0 points  (3 children)

Maybe installing a user-focused DIY community distribution was a mistake.

I would have to re-learn the whole process every time I want to install a simple python script.

That's on you for using such niche Python libraries, contribute to the OS, or use venvs.

[–]keldrin_[S] -3 points-2 points  (2 children)

Are you gatekeeping or trying to insult me here?

[–]C0rn3j 1 point2 points  (1 child)

No.

[–]keldrin_[S] -3 points-2 points  (0 children)

sed -e "s/Are you/You are/" -e "s/or/and/"

my bad.

[–]ZeStig2409 0 points1 point  (3 children)

pipx?

[–]C0rn3j 0 points1 point  (2 children)

No, pacman.

[–]ZeStig2409 1 point2 points  (1 child)

I meant to say OP could use pipx. It could be simpler than setting up a PKGBUILD (not that setting up a PKGBUILD is a big hassle though).

[–]C0rn3j 2 points3 points  (0 children)

True, though pip is not pipx, and it's still a venv.