Last active
August 6, 2021 11:42
-
-
Save krokrob/f833e9fd734bc9a4cdd0c6a9cd0b545b to your computer and use it in GitHub Desktop.
This file contains hidden or 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
REQUIRED=('pytest' 'pylint' 'ipdb' 'PyYAML' 'nbresult' 'autopep8' 'flake8' 'yapf' 'lxml' 'requests' 'bs4' 'jupyterlab' 'pandas' 'matplotlib' 'seaborn' 'plotly' 'scikit-learn' 'tensorflow' 'nbconvert' 'xgboost' 'statsmodels' 'pandas-profiling' 'jupyter-resource-usage' 'dtale') | |
PACKAGES=$(pip freeze) | |
PACKS=() | |
while read -r line; do | |
PACKS+=("$line") | |
done <<< "$PACKAGES" | |
missing=() | |
for r in ${REQUIRED[@]}; do | |
present=0 | |
for p in ${PACKS[@]}; do | |
if (($present == 0)); then | |
q=${p//==[0-9|\.]*/} | |
if [ $r = ${q} ]; then | |
present=1 | |
fi | |
fi | |
done | |
if (($present == 0)) | |
then | |
missing="${missing} ${r}" | |
fi | |
done | |
if (( ${#missing[@]} )); then | |
sentence='Try to `pip install ' | |
sentence+=$missing | |
sentence+='` again.' | |
echo '❌ Some packages are missing:' | |
echo $sentence | |
else | |
echo '✅ Everything is fine, continue the setup intructions.' | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment