Quickly call executable programs from outside the containing environment

Is there a way to expose commandline programs installed in a particular environment to the outside, similar to the way pipx does for python scripts?

That would mean a process like:

  1. a particular CLI program gets installed in an isolated environment
  2. an executable file gets exposed in the search path permanently
  3. afterwards the exposed program can be called without the need to a) explicitly activate the environment manually beforehand and b) deactivate it after the call, such that it can be used like any other commandline excutable and ideally even included in shell pipelines containing other programs from independent environments simultaneously.

There is condax. It doesn’t advertise Windows support although in an issue quite some time ago the author said it did work on Windows.

Another option is using conda run. This doesn’t put an executable in the search path but lets you run the program in its environment context without having to explicitly activate/deactivate the environment. In the past it had some problems but the past few years it’s worked pretty well for me (although I rarely use it for anything but conda run python).

Hi @jf1 yes, we have this feature in pixi and we are actually releasing a major new version in a few days.

You can install tools globally with pixi global install foo.

Check out pixi: https://pixi.sh/

(Pixi uses conda packages and defaults to conda-forge.).

If you want to learn more about the new pixi global features, we’ll explain it in the prefix.dev Community Show & Tell: https://www.youtube.com/watch?v=iEcAciJLaPM

Or join our Discord event to be able to ask questions in real time!

Wow, this looks great!

And at a first test also seems really fast :smile:
Looks as this is, what I was searching for.

Thanks a lot!

1 Like