Created
July 21, 2018 17:00
-
-
Save shaypal5/d505af9953cd86f59c750fa600ee4ba6 to your computer and use it in GitHub Desktop.
bash if-else by Python package existence
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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