Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(templates): ensure to use python3 and pip3 #3170

Merged
merged 1 commit into from Nov 1, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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