Skip to content

Commit

Permalink
correction to install_python_package fn
Browse files Browse the repository at this point in the history
  • Loading branch information
gauravsaini04 committed May 8, 2024
1 parent 0f9f285 commit 874a2af
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,16 @@ export DEBIAN_FRONTEND=noninteractive

install_python_package() {
PACKAGE=${1:-""}
shift
OPTIONS=$@

sudo_if /usr/local/python/current/bin/python -m pip uninstall --yes $PACKAGE
echo "Installing $PACKAGE..."
sudo_if /usr/local/python/current/bin/python -m pip install --user --upgrade --no-cache-dir $PACKAGE
if [ -n "$OPTIONS" ]; then
sudo_if /usr/local/python/current/bin/python -m pip install --user --upgrade --no-cache-dir "$PACKAGE" "$OPTIONS"
else
sudo_if /usr/local/python/current/bin/python -m pip install --user --upgrade --no-cache-dir "$PACKAGE"
fi
}

if [[ "$(python --version)" != "" ]] && [[ "$(pip --version)" != "" ]]; then
Expand Down

0 comments on commit 874a2af

Please sign in to comment.