0

I am working on a workflow where we have a set of python2.7 scripts that wrap around various executables in order to automate processing of scientific data. This works great for stand alone binaries. One of the executables we want to wrap is written in python3 and has various clashing libraries and PYTHONPATHS etc, etc not to mention using different pythons from our parent script. I'm looking for a way do call a different python environment with appropriate environment variables from within a given python script. The two python environments in question are each in their own miniconda environment with their own required dependencies. I can get them to run on their own, but not together. Any advice would be greatly appreciated.

sstagg
  • 1
  • 2
  • Possible duplicate of [Calling Python 2 script from Python 3](https://stackoverflow.com/questions/27863832/calling-python-2-script-from-python-3) – Daniel Glynn Aug 20 '19 at 14:22
  • @DanielGlynn That is a similar issue, but I think the unique thing about my problem is that they have clashing PYTHONPATHS and dependencies. In other words, if I call a subprocess from my parent process, it will fail because the environment variables in the parent script and login environment are incompatible with the child process. – sstagg Aug 20 '19 at 14:35
  • It might be execessive, but docker could be your solution. – Taek Aug 20 '19 at 14:47
  • @Taek, true, but getting the docker environments to talk to each other at the shell level is no fun. I'm hoping there might be a pythonic solution, or at least one that doesn't require installing another dependency. – sstagg Aug 20 '19 at 14:57

0 Answers0