I installed Python3.11 which is located usr/local/bin/python3
, which came without pip. The old Python3.10 was located in usr/bin/python3
.
I tried to install pip with sudo apt-install python3-pip
, but it seems to be attached to the old Python3.10. If I check pip --version
, the output will be this:
pip 22.0.2 from /usr/lib/python3/dist-packages/pip (python 3.10)
, but I need it for Python3.11. For example if I try to pip install requests
now, I get Requirements already satisfied: requests in /usr/lib/python3/dist-packages (2.25.1)
, which is the Python3.10 folder.
2
Answers
Maybe you need pyenv:
I’m using it to manage my virtual environments and my global environments
Your new python version(/usr/local/bin/python3) has pip.
But your symbolic links have got twisted, you couldn’t use them easily.
Try this below.
Also before you change your symbolic links, you have to use pip like this below.
If you want to use new python version as
python
ORpython3
command,the result will be like this. the second column is the binary (But in your case /usr/local/bin/python3).
Before changing all symbolic links to link new python3.11,
Let’s find a newer pip binary
the result of mine is
Let’s find the old python and pip symbolic link path.
let’s say the result is
Let’s connect symbolic links to newer python.
ln -s
creates a symbolic link.-f
option ofln
overwrites an existing symbolic link.