Home > Enterprise >  change python interpreter during runtime
change python interpreter during runtime

Time:11-10

there are two python environment 3.6 and 3.8 in my program.I can not unified the environment because there are different sdk come from different vendor.

what can I do call the two sdk at the same time.

I have try to change the environment by source different shell scripts.it can not work.

CodePudding user response:

I didn't come up with a nested way to change interpreter during runtime, before and after Googling. A naive way could be splitting your program into two parts, with each part requiring only one interpreter.

Then you can write a bash script to run these two parts sequentially or in whatever way you wish.

A possible demo could be:

#!/bin/bash
<path-to-1st-python-env> part1.py
<path-to-2nd-python-env> part2.py

CodePudding user response:

Thanks for your answer. I also thought this method,but that's very troublesome.It seems that have no better way to solve this problem.

  • Related