0

I am trying to modify an existing Docker Image and trying to install the latest version of pip using OS packages in centos:latest as base image.

The existing Dockerfile is using RUN dnf install python3-pip -y but this installs older version of pip i.e., 9.0.3-13.el8.

Is there a way i can install latest version of pip using repository package maybe using a custom repo?

Unfortunately, For some dependencies in this complex custom image, i want to ensure that i have the latest version of pip using repository package only. Can someone please suggest a possible way for this?

Ankit Vashistha
  • 325
  • 6
  • 17
  • after installing just upgrade pip `RUN pip install --upgrade pip` – royki Dec 26 '19 at 15:37
  • @royki: I have tried that as well. For some reason, when installing the package, it gets installed in `/usr/lib/python3.6/site-packages/pip/` but when i run `pip install --upgrade pip`, this is updated in `/usr/local/lib/python3.6` – Ankit Vashistha Dec 26 '19 at 15:43
  • @royki Also, i tried `pip3 install --upgrade pip` and it starts giving the following error post that: `Traceback (most recent call last): File "/usr/bin/pip3", line 16, in sys.exit(main()) TypeError: 'module' object is not callable` – Ankit Vashistha Dec 26 '19 at 15:50
  • Alright, for some reason, upgrade was done using `pip3 install --upgrade pip` but when i checked again, the update was done in `/usr/local/lib/python3.6/site-packages` but the directory used by `python3-pip` was `/usr/lib/python3.6/site-packages` because i can see this message Requirement already up-to-date: pip in /usr/local/lib/python3.6/site-packages (19.3.1) I am not sure why these different directories are used for installation and upgrade. ` – Ankit Vashistha Dec 26 '19 at 17:06

0 Answers0