Skip to content

Commit c7e6424

Browse files
authored
[Fix] Revert changes about skipping Python installation in 1375 (#1414)
1 parent 506d502 commit c7e6424

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

bentoml/saved_bundle/bentoml-init.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,13 @@ if [ -f ./python_version ]; then
1818
DESIRED_PY_VERSION=${PY_VERSION_SAVED:0:3} # returns 3.6, 3.7 or 3.8
1919
CURRENT_PY_VERSION=$(python -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")')
2020

21-
if command -v conda >/dev/null 2>&1; then
22-
echo "Installing python=$DESIRED_PY_VERSION with conda:"
23-
conda install -y -n base pkgs/main::python=$DESIRED_PY_VERSION pip
21+
if [[ "$DESIRED_PY_VERSION" == "$CURRENT_PY_VERSION" ]]; then
22+
echo "Python Version in docker base image $CURRENT_PY_VERSION matches requirement python=$DESIRED_PY_VERSION. Skipping."
2423
else
25-
if [[ "$DESIRED_PY_VERSION" != "$CURRENT_PY_VERSION" ]]; then
24+
if command -v conda >/dev/null 2>&1; then
25+
echo "Installing python=$DESIRED_PY_VERSION with conda:"
26+
conda install -y -n base pkgs/main::python=$DESIRED_PY_VERSION pip
27+
else
2628
echo "WARNING: Python Version $DESIRED_PY_VERSION is required, but $CURRENT_PY_VERSION was found."
2729
fi
2830
fi

0 commit comments

Comments
 (0)