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

modify pipx disclaimer of library installation --> include pipx inject <existing venv> <library> as an option #1411

Open
iconoclasthero opened this issue May 15, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@iconoclasthero
Copy link

$ pipx install lyrics-in-terminal python-mpd2
  installed package lyrics-in-terminal 1.5.0, installed using Python 3.12.3
  These apps are now globally available
    - lyrics
done! ✨ 🌟 ✨

No apps associated with package python-mpd2 or its dependencies. If you are attempting to install a library, pipx should not be used. Consider using pip or a similar tool instead.

Admittedly, this is a poor example because the first comment is going to be that the lyrics-in-terminal[mpd] package exists to take care of my example, but that is not at all the point.

Let's say that you have a similar application that does not have an optional library packaged with it. Or, let's say that you installed lyrics and want to add python-mpd2 after the fact without reinstalling the base application (on the git, it says "For MPD player support install python-mpd2 package as well." Further, let's also assume that you use pipx rather infrequently irattically (e.g.,< 1x/quarter)... (or whatever, point is you have an existing pipx venv and you want a library in there so it'll work right.)

What would have dramatically reduced my frustration about this, now that I know that pipx can handle the installation** of e.g., lyrics-in-terminal in the first place ,would be to have a message that, instead of disclaiming the installation of libraries mentioned that "If you are attempting to install a library: pipx cannot be used to install system-wide libraries but additional or optional libraries needed for existing pipx-managed packages can be easily "injected" into the pipx venv using `$ pipx inject [], please see https://github.com/pypa/pipx?tab=readme-ov-file#inject-a-package and the documentation for more details."

I'm fairly sure that when I go to use pipx again in a few months, it will be a very helpful reminder that, oh, yes, pipx can actually solve my problem, right here, right now, with almost no fuss or hastle, exactly what I want. I don't need to mess around with pip or another tool I can just move on with one additional pipx call. It is difficult to express in words how useful it would have been to learn of the possibility from a cli message like the one that originally learned me about pipx. (**i.e. "If you wish to install a non-Debian packaged Python application, it may be easiest to use pipx install xyz, which will manage a virtual environment for you.")

$ pipx install lyrics-in-terminal --force; pipx install python-mpd2; pipx inject lyrics-in-terminal python-mpd2 --force
--python is ignored when --force is passed. If you want to reinstall lyrics-in-terminal with /usr/bin/python3, run `pipx reinstall lyrics-in-terminal --python /usr/bin/python3` instead.
Installing to existing venv 'lyrics-in-terminal'
  installed package lyrics-in-terminal 1.5.0, installed using Python 3.12.3
  These apps are now globally available, environment available to pipx
    - lyrics
done! ✨ 🌟 ✨
No apps associated with package python-mpd2 or its dependencies. If you are attempting to install a system-wide library, pipx should not be used; consider using pip or a similar tool instead.  Use `pipx inject <pipx venv> <package>` to install libraries, additional applications in pipx-managed venv.
  injected package python-mpd2 into venv lyrics-in-terminal
done! ✨ 🌟 ✨
@chrysle
Copy link
Contributor

chrysle commented May 15, 2024

Thanks for the suggestion! This sounds indeed as if it might improve user experience. Besides, there's also the --preinstall option to pipx install that could be mentioned.

@chrysle chrysle added the enhancement New feature or request label May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants