I’m starting a new process from a Python script using subprocess. In this new process, a new virtual environment should be activated, but for some reason the old environment remains active, to deactivate the old environment, I use the deactivate call. H
My script
commands = """
call deactivate
pip install -r req.txt
./venv/Scripts/activate
""".format(script_to_run)
result = subprocess.run(commands, shell=True, executable='/bin/bash')
How can I achieve the same in Linux?