Skip to content

Commit

Permalink
Fix a recent issue /usr/bin/python3.8: No module named pip in our b…
Browse files Browse the repository at this point in the history
…uild_clif.sh.

PiperOrigin-RevId: 420775145
  • Loading branch information
pichuan committed Jan 18, 2022
1 parent 9cf1c7b commit 5469fec
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions tools/build_clif.sh
Expand Up @@ -91,12 +91,8 @@ apt-get remove "${APT_ARGS[@]}" libclang-common-9-dev
apt-get update "${APT_ARGS[@]}" && \
apt-get install "${APT_ARGS[@]}" \
"python$CLIF_PYTHON_VERSION-dev" \
"python$CLIF_PYTHON_VERSION-distutils"

# Install latest version of pip since the version on ubuntu could be outdated
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \
"python$CLIF_PYTHON_VERSION" get-pip.py && \
rm get-pip.py
"python$CLIF_PYTHON_VERSION-distutils" \
"python3-pip"

# Compile and install absl-cpp from source
wget "https://github.com/abseil/abseil-cpp/archive/$ABSL_VERSION.tar.gz" && \
Expand Down Expand Up @@ -125,7 +121,7 @@ cd /usr/src/googletest && \
make install

# Install python runtime and test dependencies
"python$CLIF_PYTHON_VERSION" -m pip install \
pip3 install \
absl-py \
parameterized \
protobuf=="$PROTOBUF_VERSION" \
Expand Down

2 comments on commit 5469fec

@Stikus
Copy link

@Stikus Stikus commented on 5469fec Jan 25, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello, thanks for quick fix but I hope it will be reverted after setuptools bug goes away.

Here are issues about this problem in get-pip pypa/get-pip#137 and setuptools pypa/setuptools#2993 pypa/setuptools#3022

Your current fix installs built-in Ubuntu pip but your script tells exactly about it the version on ubuntu could be outdated

Btw - currently with all versions available you can simple uninstall setuptools before installation of pip and everything will work:

curl -Ss -o get-pip.py https://bootstrap.pypa.io/get-pip.py
pip uninstall -y setuptools
python3 get-pip.py --force-reinstall
rm -f get-pip.py

@pichuan
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank for the for the feedback @Stikus , I just updated : 3cfe23b

Please sign in to comment.