Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 12111

How to dectivate virtualenv in Linux

$
0
0

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.

My script

commands = """call deactivatepip 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?


Viewing all articles
Browse latest Browse all 12111

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>