CI build gives a command not found error on /install/install_pip_packages.sh
The error message indicates that the Docker build process is failing at the step where it is trying to run the `/install/install_pip_packages.sh` script inside the container. The specific error is:

```
/install/install_pip_packages.sh: line 21: python3.6: command not found
```

This suggests that the Python 3.6 executable is not available in the Docker image at the time this script is being executed.

To resolve this issue, you can try the following steps:

1. **Check Python Version:**
   Confirm the available Python version in your Docker image. It seems that Python 3.6 is not installed or is not in the system's PATH.

2. **Update Install Script:**
   Update the `/install/install_pip_packages.sh` script to use the correct Python version available in your Docker image. You might need to replace `python3.6` with the appropriate Python executable name.

   For example, if the available Python executable is `python3`, you can update the script as follows:

   ```bash
   # Replace this line in install_pip_packages.sh
   python3.6 -m ensurepip

   # With this line
   python3 -m ensurepip
   ```

3. **Modify Dockerfile:**
   Ensure that the Dockerfile (`Dockerfile.cpu`) specifies the correct version of Python. You may need to install Python 3.6 explicitly if it's not included in the base image.

   Add the following lines to your Dockerfile before the problematic script:

   ```Dockerfile
   # Install Python 3.6
   RUN apt-get update && apt-get install -y python3.6
   ```

4. **Verify Dockerfile Context:**
   Ensure that all the necessary files and dependencies are available in the Docker build context. It's possible that some required files or scripts are missing.

5. **Review Dependencies:**
   Double-check other dependencies and scripts that may affect the Python installation. Sometimes, issues in earlier steps can cascade into problems in later steps.

After making these adjustments, try rebuilding the Docker image and see if the issue is resolved. If you encounter further issues, review the relevant parts of the Dockerfile and installation scripts to identify any missing dependencies or incorrect configurations. @SuryanarayanaY @giuliocn  @AbhisekOmkar, by adding this line to `Dockerfile.cpu`
```
# Install Python 3
RUN apt-get update && apt-get install -y python3.9
```
I got a different python version inside `install_pip_packages.sh`
```
0.975 ERROR: This script does not work on Python 3.5 The minimum supported Python version is 3.7. Please use https://bootstrap.pypa.io/pip/3.5/get-pip.py instead.
```
The actual version is `Python 3.5.2` 
 Hi @giuliocn ,

For nightly you need to have Python version in the range of 3.9-3.11. You need to install Python in this range.

For me it seems even though you are updating the python the python path not set to updated version. Could you try to set the path to newly installed python version. For example for me this [instructions](https://stackoverflow.com/questions/63168301/how-to-change-the-python-version-from-default-3-5-to-3-8-of-google-colab) worked for updating python version in Google colab. @SuryanarayanaY . Leaving other files unchanged, I tried to install a parallel python 3.9 command in multiple ways inside `install_pip_packages.sh`:
```
# Install python3.9
apt-get update && apt-get install -y python3.9
```
```
# Install python3.9
#sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get update 
sudo apt-get install -y python3.9
```
But when I checked the result, I couldn't find `python3.9` inside `/usr/bin`:
```
# Check parallel python installation
ls -la /usr/bin/ | grep python
python3.9 --version
```
Here is the full log of the last attempt:
<details>
```
tensorflow/tools/ci_build/ci_build.sh CPU bazel test //tensorflow/...
WORKSPACE: /workspaces/tensorflow
CI_DOCKER_BUILD_EXTRA_PARAMS: 
CI_DOCKER_EXTRA_PARAMS: 
COMMAND: bazel test //tensorflow/...
CI_COMMAND_PREFIX: ./tensorflow/tools/ci_build/builds/with_the_same_user ./tensorflow/tools/ci_build/builds/configured cpu
CONTAINER_TYPE: cpu
BUILD_TAG: tf_ci
  (docker container name will be tf_ci.cpu)

Building container (tf_ci.cpu)...
[+] Building 281.4s (11/17)                                                                                   docker:default
 => [internal] load .dockerignore                                                                                       0.1s
 => => transferring context: 2B                                                                                         0.0s
 => [internal] load build definition from Dockerfile.cpu                                                                0.1s
 => => transferring dockerfile: 654B                                                                                    0.0s
 => [internal] load metadata for docker.io/library/ubuntu:16.04                                                         0.8s
 => [auth] library/ubuntu:pull token for registry-1.docker.io                                                           0.0s
 => CACHED [ 1/12] FROM docker.io/library/ubuntu:16.04@sha256:1f1a2d56de1d604801a9671f301190704c25d604a416f59e03c04f5c  0.0s
 => [internal] load build context                                                                                       0.1s
 => => transferring context: 5.27kB                                                                                     0.0s
 => [ 2/12] COPY install/*.sh /install/                                                                                 0.2s
 => [ 3/12] RUN /install/install_bootstrap_deb_packages.sh                                                             36.4s
 => [ 4/12] RUN add-apt-repository -y ppa:openjdk-r/ppa &&     add-apt-repository -y ppa:george-edison55/cmake-3.x      1.7s 
 => [ 5/12] RUN /install/install_deb_packages.sh                                                                      204.1s 
 => ERROR [ 6/12] RUN /install/install_pip_packages.sh                                                                 37.6s 
------                                                                                                                       
 > [ 6/12] RUN /install/install_pip_packages.sh:                                                                             
0.948 Get:1 http://archive.ubuntu.com/ubuntu xenial InRelease [247 kB]
0.949 Get:2 http://ppa.launchpad.net/george-edison55/cmake-3.x/ubuntu xenial InRelease [17.5 kB]
0.968 Get:3 http://ppa.launchpad.net/openjdk-r/ppa/ubuntu xenial InRelease [20.8 kB]
0.998 Get:4 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [99.8 kB]
1.010 Get:5 http://archive.ubuntu.com/ubuntu xenial-backports InRelease [97.4 kB]
1.053 Get:6 http://ppa.launchpad.net/george-edison55/cmake-3.x/ubuntu xenial/main amd64 Packages [2019 B]
1.090 Get:7 http://security.ubuntu.com/ubuntu xenial-security InRelease [99.8 kB]
1.130 Get:8 http://ppa.launchpad.net/openjdk-r/ppa/ubuntu xenial/main amd64 Packages [19.2 kB]
1.225 Get:9 http://archive.ubuntu.com/ubuntu xenial/main amd64 Packages [1558 kB]
1.280 Get:10 http://archive.ubuntu.com/ubuntu xenial/restricted amd64 Packages [14.1 kB]
1.281 Get:11 http://archive.ubuntu.com/ubuntu xenial/universe amd64 Packages [9827 kB]
1.550 Get:12 http://archive.ubuntu.com/ubuntu xenial/multiverse amd64 Packages [176 kB]
1.562 Get:13 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages [1625 kB]
1.600 Get:14 http://archive.ubuntu.com/ubuntu xenial-updates/restricted amd64 Packages [16.4 kB]
1.601 Get:15 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages [1483 kB]
1.620 Get:16 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages [1169 kB]
1.627 Get:17 http://archive.ubuntu.com/ubuntu xenial-updates/multiverse amd64 Packages [25.0 kB]
1.645 Get:18 http://archive.ubuntu.com/ubuntu xenial-backports/main amd64 Packages [11.3 kB]
1.655 Get:19 http://archive.ubuntu.com/ubuntu xenial-backports/universe amd64 Packages [12.9 kB]
2.022 Get:20 http://security.ubuntu.com/ubuntu xenial-security/restricted amd64 Packages [15.9 kB]
2.023 Get:21 http://security.ubuntu.com/ubuntu xenial-security/universe amd64 Packages [928 kB]
2.068 Get:22 http://security.ubuntu.com/ubuntu xenial-security/multiverse amd64 Packages [8820 B]
2.524 Fetched 17.5 MB in 1s (11.0 MB/s)
2.524 Reading package lists...
3.167 Reading package lists...
3.847 Building dependency tree...
4.026 Reading state information...
4.186 The following additional packages will be installed:
4.186   cron ifupdown iproute2 isc-dhcp-client isc-dhcp-common libatm1
4.187   libdns-export162 libisc-export160 libmnl0 libpq5 libxslt1.1 libxtables11
4.187   locales logrotate netbase postgresql-9.5 postgresql-client-9.5
4.187   postgresql-client-common postgresql-common postgresql-contrib-9.5 ssl-cert
4.187   sysstat tzdata
4.190 Suggested packages:
4.190   anacron checksecurity exim4 | postfix | mail-transport-agent ppp rdnssd
4.190   iproute2-doc resolvconf avahi-autoipd isc-dhcp-client-ddns apparmor mailx
4.190   locales-all postgresql-doc-9.5 libdbd-pg-perl openssl-blacklist isag
4.190 The following NEW packages will be installed:
4.190   cron ifupdown iproute2 isc-dhcp-client isc-dhcp-common libatm1
4.190   libdns-export162 libisc-export160 libmnl0 libpq5 libxslt1.1 libxtables11
4.190   locales logrotate netbase postgresql-9.5 postgresql-client-9.5
4.190   postgresql-client-common postgresql-common postgresql-contrib-9.5
4.190   postgresql-plpython3-9.5 ssl-cert sysstat tzdata
4.310 0 upgraded, 24 newly installed, 0 to remove and 1 not upgraded.
4.310 Need to get 10.3 MB of archives.
4.310 After this operation, 42.8 MB of additional disk space will be used.
4.310 Get:1 http://archive.ubuntu.com/ubuntu xenial/main amd64 cron amd64 3.0pl1-128ubuntu2 [68.4 kB]
4.336 Get:2 http://archive.ubuntu.com/ubuntu xenial/main amd64 libatm1 amd64 1:2.5.1-1.5 [24.2 kB]
4.338 Get:3 http://archive.ubuntu.com/ubuntu xenial/main amd64 libmnl0 amd64 1.0.3-5 [12.0 kB]
4.340 Get:4 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 tzdata all 2021a-0ubuntu0.16.04 [167 kB]
4.356 Get:5 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 iproute2 amd64 4.3.0-1ubuntu3.16.04.5 [523 kB]
4.383 Get:6 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 ifupdown amd64 0.8.10ubuntu1.4 [54.9 kB]
4.383 Get:7 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libisc-export160 amd64 1:9.10.3.dfsg.P4-8ubuntu1.19 [153 kB]
4.383 Get:8 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libdns-export162 amd64 1:9.10.3.dfsg.P4-8ubuntu1.19 [665 kB]
4.395 Get:9 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 isc-dhcp-client amd64 4.3.3-5ubuntu12.10 [224 kB]
4.398 Get:10 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 isc-dhcp-common amd64 4.3.3-5ubuntu12.10 [105 kB]
4.400 Get:11 http://archive.ubuntu.com/ubuntu xenial/main amd64 libxtables11 amd64 1.6.0-2ubuntu3 [27.2 kB]
4.418 Get:12 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 locales all 2.23-0ubuntu11.3 [3197 kB]
4.509 Get:13 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 logrotate amd64 3.8.7-2ubuntu2.16.04.2 [37.7 kB]
4.510 Get:14 http://archive.ubuntu.com/ubuntu xenial/main amd64 netbase all 5.3 [12.9 kB]
4.511 Get:15 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libpq5 amd64 9.5.25-0ubuntu0.16.04.1 [79.2 kB]
4.513 Get:16 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libxslt1.1 amd64 1.1.28-2.1ubuntu0.3 [146 kB]
4.517 Get:17 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 postgresql-client-common all 173ubuntu0.3 [28.4 kB]
4.518 Get:18 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 postgresql-client-9.5 amd64 9.5.25-0ubuntu0.16.04.1 [878 kB]
4.534 Get:19 http://archive.ubuntu.com/ubuntu xenial/main amd64 ssl-cert all 1.0.37 [16.9 kB]
4.534 Get:20 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 postgresql-common all 173ubuntu0.3 [154 kB]
4.535 Get:21 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 postgresql-9.5 amd64 9.5.25-0ubuntu0.16.04.1 [3018 kB]
4.579 Get:22 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 postgresql-contrib-9.5 amd64 9.5.25-0ubuntu0.16.04.1 [451 kB]
4.604 Get:23 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 postgresql-plpython3-9.5 amd64 9.5.25-0ubuntu0.16.04.1 [40.6 kB]
4.631 Get:24 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 sysstat amd64 11.2.0-1ubuntu0.3 [242 kB]
4.894 debconf: delaying package configuration, since apt-utils is not installed
4.971 Fetched 10.3 MB in 0s (27.1 MB/s)
5.170 Selecting previously unselected package cron.
(Reading database ... 21464 files and directories currently installed.)
5.199 Preparing to unpack .../cron_3.0pl1-128ubuntu2_amd64.deb ...
5.234 Unpacking cron (3.0pl1-128ubuntu2) ...
5.551 Selecting previously unselected package libatm1:amd64.
5.553 Preparing to unpack .../libatm1_1%3a2.5.1-1.5_amd64.deb ...
5.587 Unpacking libatm1:amd64 (1:2.5.1-1.5) ...
5.836 Selecting previously unselected package libmnl0:amd64.
5.838 Preparing to unpack .../libmnl0_1.0.3-5_amd64.deb ...
5.872 Unpacking libmnl0:amd64 (1.0.3-5) ...
6.138 Selecting previously unselected package tzdata.
6.141 Preparing to unpack .../tzdata_2021a-0ubuntu0.16.04_all.deb ...
6.182 Unpacking tzdata (2021a-0ubuntu0.16.04) ...
6.710 Selecting previously unselected package iproute2.
6.712 Preparing to unpack .../iproute2_4.3.0-1ubuntu3.16.04.5_amd64.deb ...
6.745 Unpacking iproute2 (4.3.0-1ubuntu3.16.04.5) ...
7.075 Selecting previously unselected package ifupdown.
7.078 Preparing to unpack .../ifupdown_0.8.10ubuntu1.4_amd64.deb ...
7.119 Unpacking ifupdown (0.8.10ubuntu1.4) ...
7.337 Selecting previously unselected package libisc-export160.
7.340 Preparing to unpack .../libisc-export160_1%3a9.10.3.dfsg.P4-8ubuntu1.19_amd64.deb ...
7.412 Unpacking libisc-export160 (1:9.10.3.dfsg.P4-8ubuntu1.19) ...
7.654 Selecting previously unselected package libdns-export162.
7.656 Preparing to unpack .../libdns-export162_1%3a9.10.3.dfsg.P4-8ubuntu1.19_amd64.deb ...
7.693 Unpacking libdns-export162 (1:9.10.3.dfsg.P4-8ubuntu1.19) ...
7.981 Selecting previously unselected package isc-dhcp-client.
7.984 Preparing to unpack .../isc-dhcp-client_4.3.3-5ubuntu12.10_amd64.deb ...
8.017 Unpacking isc-dhcp-client (4.3.3-5ubuntu12.10) ...
8.206 Selecting previously unselected package isc-dhcp-common.
8.209 Preparing to unpack .../isc-dhcp-common_4.3.3-5ubuntu12.10_amd64.deb ...
8.290 Unpacking isc-dhcp-common (4.3.3-5ubuntu12.10) ...
8.532 Selecting previously unselected package libxtables11:amd64.
8.534 Preparing to unpack .../libxtables11_1.6.0-2ubuntu3_amd64.deb ...
8.575 Unpacking libxtables11:amd64 (1.6.0-2ubuntu3) ...
8.877 Selecting previously unselected package locales.
8.880 Preparing to unpack .../locales_2.23-0ubuntu11.3_all.deb ...
8.914 Unpacking locales (2.23-0ubuntu11.3) ...
9.496 Selecting previously unselected package logrotate.
9.498 Preparing to unpack .../logrotate_3.8.7-2ubuntu2.16.04.2_amd64.deb ...
9.534 Unpacking logrotate (3.8.7-2ubuntu2.16.04.2) ...
9.772 Selecting previously unselected package netbase.
9.774 Preparing to unpack .../archives/netbase_5.3_all.deb ...
9.807 Unpacking netbase (5.3) ...
10.06 Selecting previously unselected package libpq5:amd64.
10.06 Preparing to unpack .../libpq5_9.5.25-0ubuntu0.16.04.1_amd64.deb ...
10.11 Unpacking libpq5:amd64 (9.5.25-0ubuntu0.16.04.1) ...
10.38 Selecting previously unselected package libxslt1.1:amd64.
10.38 Preparing to unpack .../libxslt1.1_1.1.28-2.1ubuntu0.3_amd64.deb ...
10.42 Unpacking libxslt1.1:amd64 (1.1.28-2.1ubuntu0.3) ...
10.65 Selecting previously unselected package postgresql-client-common.
10.65 Preparing to unpack .../postgresql-client-common_173ubuntu0.3_all.deb ...
10.68 Unpacking postgresql-client-common (173ubuntu0.3) ...
10.91 Selecting previously unselected package postgresql-client-9.5.
10.91 Preparing to unpack .../postgresql-client-9.5_9.5.25-0ubuntu0.16.04.1_amd64.deb ...
10.94 Unpacking postgresql-client-9.5 (9.5.25-0ubuntu0.16.04.1) ...
11.26 Selecting previously unselected package ssl-cert.
11.27 Preparing to unpack .../ssl-cert_1.0.37_all.deb ...
11.30 Unpacking ssl-cert (1.0.37) ...
11.62 Selecting previously unselected package postgresql-common.
11.62 Preparing to unpack .../postgresql-common_173ubuntu0.3_all.deb ...
11.67 Adding 'diversion of /usr/bin/pg_config to /usr/bin/pg_config.libpq-dev by postgresql-common'
11.70 Unpacking postgresql-common (173ubuntu0.3) ...
12.00 Selecting previously unselected package postgresql-9.5.
12.00 Preparing to unpack .../postgresql-9.5_9.5.25-0ubuntu0.16.04.1_amd64.deb ...
12.04 Unpacking postgresql-9.5 (9.5.25-0ubuntu0.16.04.1) ...
12.53 Selecting previously unselected package postgresql-contrib-9.5.
12.53 Preparing to unpack .../postgresql-contrib-9.5_9.5.25-0ubuntu0.16.04.1_amd64.deb ...
12.57 Unpacking postgresql-contrib-9.5 (9.5.25-0ubuntu0.16.04.1) ...
12.81 Selecting previously unselected package postgresql-plpython3-9.5.
12.82 Preparing to unpack .../postgresql-plpython3-9.5_9.5.25-0ubuntu0.16.04.1_amd64.deb ...
12.85 Unpacking postgresql-plpython3-9.5 (9.5.25-0ubuntu0.16.04.1) ...
13.14 Selecting previously unselected package sysstat.
13.14 Preparing to unpack .../sysstat_11.2.0-1ubuntu0.3_amd64.deb ...
13.18 Unpacking sysstat (11.2.0-1ubuntu0.3) ...
13.33 Processing triggers for systemd (229-4ubuntu21.31) ...
13.39 Processing triggers for libc-bin (2.23-0ubuntu11.3) ...
13.58 Setting up cron (3.0pl1-128ubuntu2) ...
14.06 Adding group `crontab' (GID 107) ...
14.19 Done.
14.47 update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults
14.47 update-rc.d: warning: stop runlevel arguments (1) do not match cron Default-Stop values (none)
14.50 invoke-rc.d: could not determine current runlevel
14.50 invoke-rc.d: policy-rc.d denied execution of start.
14.54 Setting up libatm1:amd64 (1:2.5.1-1.5) ...
14.71 Setting up libmnl0:amd64 (1.0.3-5) ...
14.87 Setting up tzdata (2021a-0ubuntu0.16.04) ...
15.00 debconf: unable to initialize frontend: Dialog
15.00 debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.)
15.00 debconf: falling back to frontend: Readline
15.10 
15.10 Current default time zone: 'Etc/UTC'
15.10 Local time is now:      Wed Dec 20 16:01:07 UTC 2023.
15.10 Universal Time is now:  Wed Dec 20 16:01:07 UTC 2023.
15.10 Run 'dpkg-reconfigure tzdata' if you wish to change it.
15.10 
15.19 Setting up iproute2 (4.3.0-1ubuntu3.16.04.5) ...
15.56 Setting up ifupdown (0.8.10ubuntu1.4) ...
16.00 Creating /etc/network/interfaces.
16.17 Setting up libisc-export160 (1:9.10.3.dfsg.P4-8ubuntu1.19) ...
16.28 Setting up libdns-export162 (1:9.10.3.dfsg.P4-8ubuntu1.19) ...
16.38 Setting up isc-dhcp-client (4.3.3-5ubuntu12.10) ...
16.64 Setting up isc-dhcp-common (4.3.3-5ubuntu12.10) ...
16.74 Setting up libxtables11:amd64 (1.6.0-2ubuntu3) ...
16.85 Setting up locales (2.23-0ubuntu11.3) ...
17.00 debconf: unable to initialize frontend: Dialog
17.00 debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.)
17.00 debconf: falling back to frontend: Readline
17.55 Generating locales (this might take a while)...
17.56 Generation complete.
17.66 Setting up logrotate (3.8.7-2ubuntu2.16.04.2) ...
17.83 Setting up netbase (5.3) ...
18.02 Setting up libpq5:amd64 (9.5.25-0ubuntu0.16.04.1) ...
18.12 Setting up libxslt1.1:amd64 (1.1.28-2.1ubuntu0.3) ...
18.22 Setting up postgresql-client-common (173ubuntu0.3) ...
18.35 Setting up postgresql-client-9.5 (9.5.25-0ubuntu0.16.04.1) ...
18.88 update-alternatives: using /usr/share/postgresql/9.5/man/man1/psql.1.gz to provide /usr/share/man/man1/psql.1.gz (psql.1.gz) in auto mode
18.97 Setting up ssl-cert (1.0.37) ...
19.09 debconf: unable to initialize frontend: Dialog
19.09 debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.)
19.09 debconf: falling back to frontend: Readline
19.37 Setting up postgresql-common (173ubuntu0.3) ...
19.59 debconf: unable to initialize frontend: Dialog
19.59 debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.)
19.59 debconf: falling back to frontend: Readline
20.28 Adding user postgres to group ssl-cert
20.47 
20.47 Creating config file /etc/postgresql-common/createcluster.conf with new version
20.58 
20.58 Creating config file /etc/logrotate.d/postgresql-common with new version
20.65 Building PostgreSQL dictionaries from installed myspell/hunspell packages...
20.65 Removing obsolete dictionary files:
20.77 invoke-rc.d: could not determine current runlevel
20.78 invoke-rc.d: policy-rc.d denied execution of start.
20.87 Setting up postgresql-9.5 (9.5.25-0ubuntu0.16.04.1) ...
21.00 debconf: unable to initialize frontend: Dialog
21.00 debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.)
21.00 debconf: falling back to frontend: Readline
21.14 Creating new cluster 9.5/main ...
21.14   config /etc/postgresql/9.5/main
21.14   data   /var/lib/postgresql/9.5/main
21.14   locale C
35.76   socket /var/run/postgresql
35.76   port   5432
35.82 update-alternatives: using /usr/share/postgresql/9.5/man/man1/postmaster.1.gz to provide /usr/share/man/man1/postmaster.1.gz (postmaster.1.gz) in auto mode
35.85 invoke-rc.d: could not determine current runlevel
35.86 invoke-rc.d: policy-rc.d denied execution of start.
35.90 Setting up postgresql-contrib-9.5 (9.5.25-0ubuntu0.16.04.1) ...
36.08 Setting up postgresql-plpython3-9.5 (9.5.25-0ubuntu0.16.04.1) ...
36.18 Setting up sysstat (11.2.0-1ubuntu0.3) ...
36.49 debconf: unable to initialize frontend: Dialog
36.49 debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.)
36.49 debconf: falling back to frontend: Readline
36.56 
36.56 Creating config file /etc/default/sysstat with new version
36.60 update-alternatives: using /usr/bin/sar.sysstat to provide /usr/bin/sar (sar) in auto mode
36.85 Processing triggers for systemd (229-4ubuntu21.31) ...
36.91 Processing triggers for libc-bin (2.23-0ubuntu11.3) ...
37.18 lrwxrwxrwx 1 root root         26 Aug 16  2019 dh_pypy -> ../share/dh-python/dh_pypy
37.18 -rwxr-xr-x 1 root root       1056 Nov 24  2017 dh_python2
37.18 lrwxrwxrwx 1 root root         29 Aug 16  2019 dh_python3 -> ../share/dh-python/dh_python3
37.18 lrwxrwxrwx 1 root root         23 Mar  1  2021 pdb2.7 -> ../lib/python2.7/pdb.py
37.18 lrwxrwxrwx 1 root root         23 Jan 26  2021 pdb3.5 -> ../lib/python3.5/pdb.py
37.18 lrwxrwxrwx 1 root root         31 Mar 23  2016 py3versions -> ../share/python3/py3versions.py
37.18 lrwxrwxrwx 1 root root         26 Aug 16  2019 pybuild -> ../share/dh-python/pybuild
37.18 lrwxrwxrwx 1 root root          9 Nov 24  2017 python -> python2.7
37.18 lrwxrwxrwx 1 root root         16 Nov 24  2017 python-config -> python2.7-config
37.18 lrwxrwxrwx 1 root root          9 Nov 24  2017 python2 -> python2.7
37.18 lrwxrwxrwx 1 root root         16 Nov 24  2017 python2-config -> python2.7-config
37.18 -rwxr-xr-x 1 root root    3492624 Mar  1  2021 python2.7
37.18 lrwxrwxrwx 1 root root         33 Mar  1  2021 python2.7-config -> x86_64-linux-gnu-python2.7-config
37.18 lrwxrwxrwx 1 root root          9 Mar 23  2016 python3 -> python3.5
37.18 lrwxrwxrwx 1 root root         16 Mar 23  2016 python3-config -> python3.5-config
37.18 -rwxr-xr-x 2 root root    4456208 Jan 26  2021 python3.5
37.18 lrwxrwxrwx 1 root root         33 Jan 26  2021 python3.5-config -> x86_64-linux-gnu-python3.5-config
37.18 -rwxr-xr-x 2 root root    4456208 Jan 26  2021 python3.5m
37.18 lrwxrwxrwx 1 root root         34 Jan 26  2021 python3.5m-config -> x86_64-linux-gnu-python3.5m-config
37.18 lrwxrwxrwx 1 root root         10 Mar 23  2016 python3m -> python3.5m
37.18 lrwxrwxrwx 1 root root         17 Mar 23  2016 python3m-config -> python3.5m-config
37.18 lrwxrwxrwx 1 root root         29 Nov 24  2017 pyversions -> ../share/python/pyversions.py
37.18 lrwxrwxrwx 1 root root         33 Nov 24  2017 x86_64-linux-gnu-python-config -> x86_64-linux-gnu-python2.7-config
37.18 -rwxr-xr-x 1 root root       2909 Mar  1  2021 x86_64-linux-gnu-python2.7-config
37.18 lrwxrwxrwx 1 root root         33 Mar 23  2016 x86_64-linux-gnu-python3-config -> x86_64-linux-gnu-python3.5-config
37.18 lrwxrwxrwx 1 root root         34 Jan 26  2021 x86_64-linux-gnu-python3.5-config -> x86_64-linux-gnu-python3.5m-config
37.18 -rwxr-xr-x 1 root root       3185 Jan 26  2021 x86_64-linux-gnu-python3.5m-config
37.18 lrwxrwxrwx 1 root root         34 Mar 23  2016 x86_64-linux-gnu-python3m-config -> x86_64-linux-gnu-python3.5m-config
37.18 /install/install_pip_packages.sh: line 25: python3.9: command not found
------
Dockerfile.cpu:11
--------------------
   9 |         add-apt-repository -y ppa:george-edison55/cmake-3.x
  10 |     RUN /install/install_deb_packages.sh
  11 | >>> RUN /install/install_pip_packages.sh
  12 |     RUN /install/install_bazel.sh
  13 |     RUN /install/install_proto3.sh
--------------------
ERROR: failed to solve: process "/bin/sh -c /install/install_pip_packages.sh" did not complete successfully: exit code: 127
ERROR: docker build failed. Dockerfile is at /workspaces/tensorflow/tensorflow/tools/ci_build/Dockerfile.cpu
```
</details> CC: @angerson , Could you have any pointers here! @giuliocn Are you able to resolve this issue? 
I am trying to perform the sanity check on a sample file using docker and got the same error:
`ERROR: failed to solve: process "/bin/sh -c /install/install_pip_packages.sh" did not complete successfully: exit code: 127`

I have also added `RUN apt-get update && apt-get install -y python3.9` before the error line in `Dockerfile.cpu` but it's not picking up on this version either @mahrukhS I am not sure yet. Until now, I have tried the following :

1.  Installing `python3.9` before the error line in `Dockerfile.cpu`, which doesn't work because `python3.9` doesn't exist inside `/usr/bin` after installing the package. Instead it finds `python3.5` through a symbolic link, you can check this by running:
```
# Check parallel python installation
ls -la /usr/bin/ | grep python
python3 --version
``` 
2.  Installing `python3.9` before the error line in `install_pip_packages.sh`, which doesn't work because `python3.9` doesn't exist inside `/usr/bin` after installing the package. Instead it finds `python3.5` through a symbolic link, you can check this by running the same snippet.

3. Changing the script used to install pip to `https://bootstrap.pypa.io/pip/3.5/get-pip.py`. But this approach creates several  issues later in the script because `python3.5` is no longer supported.

In conclusion, I believe that a parallel python installation would certainly solve the issue. In order to proceed I would like to know if `python3.9` was correctly installed by reading the corresponding system logs. Have you any idea of how I can access them? Bard suggests this command `journalctl` ...

UPDATE: @SuryanarayanaY I managed to build and install a newer version of python from source, exactly `3.11.7`, by modifying `/install/build_and_install_python.sh`. But, when I run `python3.11 get-pip.py` it raises a SSL error...
```
13.06 Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
------
Dockerfile.cpu:12
--------------------
  10 |     RUN /install/install_deb_packages.sh
  11 |     RUN /install/build_and_install_python__cpu_tests.sh 3.11.7
  12 | >>> RUN /install/install_pip_packages.sh
  13 |     RUN /install/install_bazel.sh
  14 |     RUN /install/install_proto3.sh
--------------------
``` 

 Solved issue and opened a draft pull request. @SuryanarayanaY Would you like to review my changes? #62898  @giuliocn,
Could you please confirm whether the issue is resolved in the latest TensorFlow version and for the PR raised which is draft stage would be cleared and then it will assign the reviewer for the review.

https://github.com/tensorflow/tensorflow/pull/62720

https://github.com/tensorflow/tensorflow/pull/62898


Thank you!

Steps to error:

1. I forked Tensorflow `master` branch 
2. WITH a Github workspace I created a new branch for editing.
3. I tried to run CI tests from the `/workspaces/tensorflow/` directory with command:
```
tensorflow/tools/ci_build/ci_build.sh CPU bazel test //tensorflow/...
```
4. This led me to the following error:
<details>
```
/...
WORKSPACE: /workspaces/tensorflow
CI_DOCKER_BUILD_EXTRA_PARAMS: 
CI_DOCKER_EXTRA_PARAMS: 
COMMAND: bazel test //tensorflow/...
CI_COMMAND_PREFIX: ./tensorflow/tools/ci_build/builds/with_the_same_user ./tensorflow/tools/ci_build/builds/configured cpu
CONTAINER_TYPE: cpu
BUILD_TAG: tf_ci
  (docker container name will be tf_ci.cpu)

Building container (tf_ci.cpu)...
[+] Building 1.7s (11/17)                                                                                     docker:default
 => [internal] load .dockerignore                                                                                       0.1s
 => => transferring context: 2B                                                                                         0.0s
 => [internal] load build definition from Dockerfile.cpu                                                                0.1s
 => => transferring dockerfile: 654B                                                                                    0.0s
 => [internal] load metadata for docker.io/library/ubuntu:16.04                                                         0.8s
 => [auth] library/ubuntu:pull token for registry-1.docker.io                                                           0.0s
 => [ 1/12] FROM docker.io/library/ubuntu:16.04@sha256:1f1a2d56de1d604801a9671f301190704c25d604a416f59e03c04f5c6ffee0d  0.0s
 => [internal] load build context                                                                                       0.1s
 => => transferring context: 1.73kB                                                                                     0.0s
 => CACHED [ 2/12] COPY install/*.sh /install/                                                                          0.0s
 => CACHED [ 3/12] RUN /install/install_bootstrap_deb_packages.sh                                                       0.0s
 => CACHED [ 4/12] RUN add-apt-repository -y ppa:openjdk-r/ppa &&     add-apt-repository -y ppa:george-edison55/cmake-  0.0s
 => CACHED [ 5/12] RUN /install/install_deb_packages.sh                                                                 0.0s
 => ERROR [ 6/12] RUN /install/install_pip_packages.sh                                                                  0.6s
------                                                                                                                       
 > [ 6/12] RUN /install/install_pip_packages.sh:                                                                             
0.359 --2023-12-15 16:46:42--  https://bootstrap.pypa.io/get-pip.py
0.359 Resolving bootstrap.pypa.io (bootstrap.pypa.io)... 151.101.36.175, 2a04:4e42:9::175
0.383 Connecting to bootstrap.pypa.io (bootstrap.pypa.io)|151.101.36.175|:443... connected.
0.393 HTTP request sent, awaiting response... 200 OK
0.399 Length: 2632263 (2.5M) [text/x-python]
0.399 Saving to: 'get-pip.py'
0.399 
0.399      0K .......... .......... .......... .......... ..........  1% 35.2M 0s
[...]
0.430   2500K .......... .......... .......... .......... .......... 99%  120M 0s
0.430   2550K .......... ..........                                 100%  130M=0.03s
0.430 
0.430 2023-12-15 16:46:42 (81.1 MB/s) - 'get-pip.py' saved [2632263/2632263]
0.430 
0.432 /install/install_pip_packages.sh: line 21: python3.6: command not found
------
Dockerfile.cpu:11
--------------------
   9 |         add-apt-repository -y ppa:george-edison55/cmake-3.x
  10 |     RUN /install/install_deb_packages.sh
  11 | >>> RUN /install/install_pip_packages.sh
  12 |     RUN /install/install_bazel.sh
  13 |     RUN /install/install_proto3.sh
--------------------
ERROR: failed to solve: process "/bin/sh -c /install/install_pip_packages.sh" did not complete successfully: exit code: 127
ERROR: docker build failed. Dockerfile is at /workspaces/tensorflow/tensorflow/tools/ci_build/Dockerfile.cpu
```
</details>