fix(templates): ensure to use python3 and pip3
@@ -527,28 +527,28 @@ BENTOML_VERSION=${BENTOML_VERSION:-"""
# Install python packages, prefer installing the requirements.lock.txt file if it exist
if [ -f "$REQUIREMENTS_LOCK" ]; then
echo "Installing pip packages from 'requirements.lock.txt'.."
- pip install -r "$REQUIREMENTS_LOCK" "${PIP_ARGS[@]}"
+ pip3 install -r "$REQUIREMENTS_LOCK" "${PIP_ARGS[@]}"
else
if [ -f "$REQUIREMENTS_TXT" ]; then
echo "Installing pip packages from 'requirements.txt'.."
- pip install -r "$REQUIREMENTS_TXT" "${PIP_ARGS[@]}"
+ pip3 install -r "$REQUIREMENTS_TXT" "${PIP_ARGS[@]}"
fi
fi
# Install user-provided wheels
if [ -d "$WHEELS_DIR" ]; then
echo "Installing wheels packaged in Bento.."
- pip install "$WHEELS_DIR"/*.whl "${PIP_ARGS[@]}"
+ pip3 install "$WHEELS_DIR"/*.whl "${PIP_ARGS[@]}"
fi
# Install the BentoML from PyPI if it's not already installed
-if python -c "import bentoml" &> /dev/null; then
- existing_bentoml_version=$(python -c "import bentoml; print(bentoml.__version__)")
+if python3 -c "import bentoml" &> /dev/null; then
+ existing_bentoml_version=$(python3 -c "import bentoml; print(bentoml.__version__)")
if [ "$existing_bentoml_version" != "$BENTOML_VERSION" ]; then
echo "WARNING: using BentoML version ${existing_bentoml_version}"
fi
else
- pip install bentoml=="$BENTOML_VERSION"
+ pip3 install bentoml=="$BENTOML_VERSION"
fi
"""
)
