Skip to content

Instantly share code, notes, and snippets.

@kirkins
Created July 4, 2017 13:02
Show Gist options
  • Save kirkins/e5679303b3c01e97154eb0ce1f335b88 to your computer and use it in GitHub Desktop.
Save kirkins/e5679303b3c01e97154eb0ce1f335b88 to your computer and use it in GitHub Desktop.
Bash command to install with pip and save to requirments
pip_install_save() {
package_name=$1
requirements_file=$2
if [[ -z $requirements_file ]]
then
requirements_file='./requirements.txt'
fi
sudo pip install $package_name && pip freeze | grep -i $package_name >> $requirements_file
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment