I'm trying to build a docker image to run some tests, and I'm having trouble convincing ubuntu to install python 3.9 and pip, and NOT python3.8.
starting Docker unbuntu:latest, it's no problem to install python3.9, but there is no pip. Ok, I'll try doing what all the answers suggests:
apt-get install python3-pip
but this installs **all ** of python3.8, plus other junk. Now, it does work at this point, but it bugs me to have a completely unnecessary version of python in an image that I want to be as small as it can be.
No, uninstalling 3.8 afterwards doesn't work, it removes pip.
How can I get python3.9, with pip, and no python3.8?
I did see this: How to install pip for Python 3.9 on Ubuntu 20.04
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
And when you run the script, it complains about needing distutils. No problem:
sudo apt-get install python3-distutils
And what does python3-distutils depend on? Why, python3.8, of course!