conda_subprocess.process.Popen

Contents

conda_subprocess.process.Popen#

conda_subprocess.process.Popen(args, bufsize=-1, stdin=None, stdout=None, stderr=None, preexec_fn=None, close_fds=True, cwd=None, env=None, prefix_name=None, prefix_path=None, universal_newlines=None, startupinfo=None, creationflags=0, restore_signals=True, start_new_session=False, pass_fds=(), user=None, group=None, extra_groups=None, encoding=None, errors=None, text=None, umask=-1)[source]#

Execute args in a different conda environment, mirroring the standard library’s subprocess.Popen interface.

In addition to the regular subprocess.Popen arguments, this accepts:

Parameters:
  • prefix_name (str) – Name of the conda environment the command should be executed in, e.g. "py312".

  • prefix_path (str) – Absolute path of the conda environment the command should be executed in, e.g. "/home/user/mambaforge/envs/py312".

If both prefix_name and prefix_path are None, the currently active conda environment is used. prefix_path takes precedence if both are specified.

The shell parameter is not supported - commands are always executed via the conda activation wrapper script, not a shell. The pipesize and process_group parameters were removed for compatibility with Python 3.9. env is merged on top of the current process environment rather than replacing it.