How to Activate virtualenv in a Script

Let’s say you want to write a script that executes a command inside a virtualenv, you can easily do this by using the source command available in Bash. Here’s a sample script

#!/bin/bash
source "/path/to/your/virtualenv/bin/activate"
yourcommand...

Leave a Reply

Your email address will not be published. Required fields are marked *