I haven't found a way to install pip for python3.9 . When I run the command sudo apt install python3-pip it installs pip for pythpn3.8, not 3.9. If I try to use sudo apt install python3.9-pip it gives an error.
I want to install numpy, but if I use pip3 install numpy it installs it for python3.8 and not 3.9.
Ubuntu version is 20.04
21 Answer
You can install pip for python3.9 using get-pip.py as the official documentation as well as the github page describes it:
curl -o get-pip.py
python3.9 get-pip.pyThis script will also place binaries in your ~/.local/bin, so you can optionally add this directory to PATH.
echo 'export PATH=~/.local/bin/:$PATH' >> ~/.bashrc
source ~/.bashrcWhen you do that, you might want to remove ~/.local/bin/pip and ~/.local/bin/pip3 and only keep ~/.local/bin/pip3.9 to not replace the already available commands.
Finally, check the proper installation:
$ pip3.9 -V
pip 21.0.1 from /home/user/.local/lib/python3.9/site-packages/pip (python 3.9) 2