Inject packages¶
Add extra packages into an existing pipx-managed environment with pipx inject.
Inject a package¶
Add matplotlib to the ipython environment:
$ pipx inject ipython matplotlib
Inject several at once, from a requirements file, or both:
$ pipx inject ipython matplotlib pandas
$ pipx inject ipython -r useful-packages.txt
$ pipx inject ipython extra-pkg -r more-packages.txt
Scripts can request the versioned result envelope from either command:
$ pipx inject ipython matplotlib --output json
$ pipx uninject ipython matplotlib --output json
Expose injected apps¶
Injected packages do not add their entry points to your PATH by default. Use --include-apps to expose them:
$ pipx inject ipython black --include-apps
--include-deps exposes apps and manual pages from every dependency. Use --include-resources-from PACKAGE to
expose one dependency, repeating it to select more. Both options imply --include-apps.
$ pipx inject robotframework-keyta robotframework-browser-batteries --include-resources-from robotframework-browser
For exposing apps from an already-installed environment, see Expose apps.
Other flags¶
--force/-freinstalls the package even when it is already injected.--editable/-einstalls the package in editable (development) mode.--with-suffixtargets a suffixed venv (for exampleipython_3.11).--pip-argspasses extra arguments to pip (for example--pip-args='--no-cache-dir').--index-url/-isets the package index URL for this inject.--system-site-packagesgives the venv access to the system site-packages.
Verify it¶
$ pipx list --include-injected
The injected packages appear under their host environment.