Skip to content

Instantly share code, notes, and snippets.

@clamytoe
Created April 29, 2017 09:48
Show Gist options
  • Save clamytoe/adfba08b99df393183f874b3175946a7 to your computer and use it in GitHub Desktop.
Save clamytoe/adfba08b99df393183f874b3175946a7 to your computer and use it in GitHub Desktop.
Creates a python3 virtual environment and install any dependencies if the requirements.txt is found in the directory from which it is being executed.
#!/usr/bin/env bash
# it won't stay in the virtual env so you will
# have to activate the environment by hand:
#
# source venv/bin/activate
python3 -m venv venv
source venv/bin/activate
if [ -f "requirements.txt" ]; then
pip install -r requirements.txt
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment