Option to install package globally for multi-user access
See original GitHub issueHi All, not sure if this qualifies as a feature request, or if it’s already possible and just needs to be documented?
pipx by default installs its virtualenvs in a folder inside the user’s home directory (ie ~/.local/pipx/venvs/
), and installs the entrypoint binaries for those packages/virtualenvs in the user’s personal path (ie ~/.local/bin
).
Is it possible to install packages with pipx such that they are globally executable by all users on a system (ie install entrypoint binaries in /usr/local/bin
, install virtualenvs somewhere that all users can access them?
How would this feature be useful?
Having this ability would make pipx a prime candidate for people looking to deploy python software in multi-user environments. Without this ability, pipx is not usable at all in such situations
Describe the solution you’d like
Ideally, some kind of --shared
or --global
flag would be the most straightforward solution, but even something like an optional environment variable would be nice
Ex: sudo pipx install --global cowsay
Describe alternatives you’ve considered
There are currently no alternatives / workarounds that I’m aware of. I cannot find anything about this in the documentation, the github issues, or on the web
Issue Analytics
- State:
- Created 2 years ago
- Reactions:4
- Comments:11 (8 by maintainers)
Top GitHub Comments
I definitely would like to have a
--global
option for pipx. I’ve put some thought into how this could be done (fairly) reasonably:PIPX_GLOBAL_HOME
PIPX_GLOBAL_BIN_DIR
--local
can be specified to exclude global infoinstall
output changes to “These apps are now locally available”--global
:PIPX_GLOBAL_HOME
, or distro-specific global install dir, or/opt/pipx/
(failover)PIPX_GLOBAL_BIN_DIR
, the distro-specific global bin dir, or/usr/local/bin/
(failover)sudo
/home/someuser/.local/pipx
, owned bysomeuser
, asroot
. Did you mean to use--global
?foopkg
locally for the userroot
. Did you mean to use--global
?Example usage:
All-in-all, that’s a fair amount of work, but not a ton of work to make the change, but I think that all of that work would be necessary to fully implement this change.
Alternately,
--global
could just do an override of the existingPIPX_HOME
andPIPX_BIN_DIR
env-vars, using distro-specific settings. This just means thatsudo pipx list --global
is required to read global items. I just like the UX ofpipx list
showing global and local installs.I think it would be nice to have a switch for global install. For example when using
doas
instead ofsudo
I had to first dodoas su
to run the pipx command with the environment variables as root. It would be a lot easier to just dodoas pipx install --global cowsay
.