Created
October 7, 2024 17:57
-
-
Save mrpollo/db8c5d52e63e82dee25c993d1d06d813 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
PYTHON_VERSION=$(python3 --version 2>&1 | awk '{print $2}') | |
REQUIRED_VERSION="3.11" | |
if [[ "$(printf '%s\n' "$REQUIRED_VERSION" "$PYTHON_VERSION" | sort -V | head -n1)" == "$REQUIRED_VERSION" ]]; then | |
python3 -m pip install --break-system-packages -r ${DIR}/requirements.txt | |
else | |
if [ -n "$VIRTUAL_ENV" ]; then | |
# virtual environments don't allow --user option | |
python -m pip install -r ${DIR}/requirements.txt | |
else | |
python3 -m pip install --user -r ${DIR}/requirements.txt | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment