Skip to content

Commit

Permalink
fix(templates): ensure to use python3 and pip3 (#3170)
Browse files Browse the repository at this point in the history
  • Loading branch information
aarnphm committed Nov 1, 2022
1 parent 60029d0 commit 339fd18
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/bentoml/_internal/bento/build_config.py
Expand Up @@ -527,28 +527,28 @@ def write_to_bento(self, bento_fs: FS, build_ctx: str) -> None:
# 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
"""
)
Expand Down

0 comments on commit 339fd18

Please sign in to comment.