update pip to be consistent with python in ubuntu 20.04 - python

I have python 3.8 as the default install with ubuntu 20.04.
I have upgraded to python 3.11.
However, if i do pip3 --version is see this:
pip 20.0.2 from /usr/lib/python3/dist-packages/pip (python 3.8)
In windows i just do pip install <package> and i want to achieve the same level of simplicity in ubuntu.
How to get this to upgrade too (python 3.11) or whatever the latest version of python is in Ubuntu ?

Related

Is pip 22.1.2 compatible with python 3.7.11

I have got python 3.7.11 installed on my server, The client asks if I can have pip 22.1.2 with the python 3.7.11 version?
Is pip 22.1.2 even compatible with 3.7.11 ?
Yes, it's compatible (https://pip.pypa.io/en/stable/installation/#:~:text=Compatibility,3.9%2C%203.10%20and%20latest%20PyPy3.)
The current version (v22.2) of pip works on:
Windows, Linux and MacOS.
CPython 3.7, 3.8, 3.9, 3.10 and latest PyPy3.
pip 22.1 requires Python >= 3.7. So yes, it's compatible. To up/down-grade:
python3.7 -m pip install --upgrade pip==22.1.2

Upgrading pip3 for newer python version

I upgraded python from 3.6.1 to 3.9.2. However, and when I check the pip3 version, it's still using the old python:
$ pip3 --version
pip 21.0.1 from /usr/local/lib/python3.6/site-packages/pip (python 3.6)
My objective would be to upgrade pip but, more importantly, that pip3 pointed to /usr/local/lib/python3.9/site-packages/pip in order to use the upgraded python.
P.S. Erasing and reinstalling pip3 did not work, it still takes the old python3.

Why does yum install python3 install python3.6

I have noticed that yum install python3 or apt-get install python3 python 3.6 but I am unable to understand why it installs this specific version; 3.8 is the latest version of python. Why does it pick 3.6 in specific ?
This just depends on the OS you are using. Each OS packages a certain version of python and sticks with it. For example:
CentOS 7: python 3.6
CentOS 8: python 3.6
Ubuntu 16.04: python 3.5
Ubuntu 18.04: python 3.6
Ubuntu 20.04: python 3.8
NOTE: There are some OS that use rolling releases and that thus will update their default python version, but that is more rare.

MacOS - Are my pip and pip3 locations correct?

I am new to python (not new to programming) and unfortunately butchered my previous python 3.7 installation while figuring things out. Long story short, I ended up deleting and reinstalling pip3, which in turn made the standard pip command (for the 2.7 pre-installed version of python o macOS) not exist. I've managed to get both installed again but am concerned with their locations.
My question is regarding the locations of both pip and pip3 when running the pip --version as well as the pip3 --version command.
Below is the output for these commands:
pip --version
pip 19.3.1 from /Users/Wyatt/Library/Python/2.7/lib/python/site-packages/pip (python 2.7)
pip3 --version
pip 19.2.3 from /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pip (python 3.8)
I believe pip3 is in the correct location, but feel that the pip command should not be located inside of my user library, but the system library like pip3. Is this correct, and if not, how can I fix this?
On my local machine MacOs the default pip resides at the following location
pip --version
pip 19.3.1 from /Library/Python/2.7/site-packages/pip-19.3.1-py2.7.egg/pip (python 2.7)
And after installing python3 using HomeBrew brew install python3, pip3 location is the following.
pip3 --version
pip 19.3.1 from /usr/local/lib/python3.7/site-packages/pip (python 3.7)

AWS CLI is using Python 2 instead of Python 3

I have installed Python3 and pip3 on my Macbook pro.
Running python --version shows Python 3.6.3
Running pip --version shows pip 9.0.1 from /usr/local/lib/python3.6/site-packages (python 3.6)
however running aws --version shows aws-cli/1.11.170 Python/2.7.10 Darwin/16.7.0 botocore/1.7.28
Looks like it's using python2. How do I fix this?
Why is it really an issue?
I assume you installed the AWS CLI tool by downloading the installer directly. If you want to "fix" it then uninstall the CLI tool, and then install it through pip with pip install awscli.

Categories

Resources