Skip to content

Instantly share code, notes, and snippets.

@TheNerdMan
Created April 28, 2024 00:07
Show Gist options
  • Save TheNerdMan/d792eb6ef1bc98166dc81eb81c9935b8 to your computer and use it in GitHub Desktop.
Save TheNerdMan/d792eb6ef1bc98166dc81eb81c9935b8 to your computer and use it in GitHub Desktop.
Safe pip, for when some pip installs are broken for some reason
#!/bin/bash
safe_pip() {
if [ -f "./requirements.txt" ]; then
echo "Safely installing each pip in this dir's requirements.txt";
cat requirements.txt | sed -e '/^\s*#.*$/d' -e '/^\s*$/d' | xargs -n 1 pip install;
else
echo "no requirements.txt found!"
fi
}
safe_pip
@TheNerdMan
Copy link
Author

Would also be nice to check if youre in an venv but I cba to do that rn its 1am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment