Skip to content

Instantly share code, notes, and snippets.

@shaypal5
Created July 21, 2018 17:00
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save shaypal5/d505af9953cd86f59c750fa600ee4ba6 to your computer and use it in GitHub Desktop.
Save shaypal5/d505af9953cd86f59c750fa600ee4ba6 to your computer and use it in GitHub Desktop.
bash if-else by Python package existence
# an example checking if the pandas package is installed
if python -c 'import pkgutil; exit(not pkgutil.find_loader("pandas"))'; then
echo 'pandas found'
else
echo 'pandas not found'
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment