If you just need to use another python, then I believe that you just need to use the full path to another python in command.
executed_env (.. source activate executed_env Linux) which python. , HOME/.conda/envs/executed_env/bin/python, , - .. command = "HOME/.conda/envs/executed_env/bin/python executed.py --option1 -dir /path/to/dir".
, executed.py python.
- py27
conda create -n py27 python=2.7, trigger_env. - py35
conda create -n py35 python=3.5, executed_env. - python py35,
source activate py35, which python ( EXECUTED_PYTHON ). source deactivate. executed.py
import sys
print(sys.version)
trigger.py ( , )
command = "EXECUTED_PYTHON executed.py --option1 -dir /path/to/dir"
args = shlex.split(command)
my_subprocess = subprocess.Popen(args)
trigger_env - source activate py27 python trigger.py.
3.5.2 |Continuum Analytics, Inc. [...] (3.5 - ). , executed_env.