title: How to start and run a virtualenv in python script?
body: <p>I'm trying to create a virtual environment, start it, and then have every command after that be executed in the virtual environment. </p>
  
  <pre><code>    1. os.system("curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py")
      2. os.system("python3 get-pip.py")
      3. os.system("mkdir Apps")
      4. os.system("pip3 install virtualenv")
      5. os.system("virtualenv virt")
      6. os.system("source virt/bin/activate")
      7. os.system("pip3 install flask")
  </code></pre>
  
  <p>This is the code I have right now and I am trying to create the virtual environment on line (5) and then trying to activate it on line (6) and then do the 7th line (install flask) on the virtual environment. </p>
  
  <p>I also have tried <code>os.system('. virt/bin/activate')</code> but every-time I run the python file it goes through and it does everything except start the virtual environment. </p>
  
  <p>I am running this on the terminal on Mac. </p>