Python install mess

Asked by teo1978 on 2020-07-18

NOTE: I have no idea what the latest version of Python is. I never chose what version to install. Python was installed on my system as a dependency because of installing something else. I barely know what pip is (sort of to python what npm is to javascript or what composer is to php, right?) and I only pip-install'ed stuff I needed to use.

So, after upgrading from Ubuntu 16.04 to 20.04 I was trying to get TortoiseHg to work (https://foss.heptapod.net/mercurial/tortoisehg/thg/) and when attempting to install a pip module that seemed not to be installed, I saw this error issued by pip:

DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support

So, without knowing anything, that suggests that my version of python is age-old.

That's annoying to start with. Why didn't Ubuntu keep it up to date?

Anyway, I tried:

$ sudo apt-get install python

I know I don't know anything. I'd expect this to be a starting point to figure out what I need to do.

This was the output:
$ ubuntu-bug install python
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'python-is-python2' instead of 'python'
python-is-python2 is already the newest version (2.7.17-4).

So, again without knowing anything, this seems to tell me that I already have the latest version of python.

By doing more research I see the latest version is 3.something, and I see there is also a python-is-python3 package.

I don't know what this python-is-pythonN mess is about. I suspect maybe version 3 had critical breaking changes, so if I have version 2.something installed apt can't just upgrade to version 3 transparently without breaking things. But then I'd expect it to give me some hint.

Since you went through all the trouble of creating packages called python-is-python2 and python-is-python3, and even automatically "translating" 'python' to 'python-is-python2', it shouldn't be too much to ask, that the output of the above commands gave me some hint along the lines of "Python3 is available. More information here: ......................."

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: python-is-python2 2.7.17-4
ProcVersionSignature: Ubuntu 5.4.0-40.44-generic 5.4.44
Uname: Linux 5.4.0-40-generic x86_64
NonfreeKernelModules: nvidia
ApportVersion: 2.20.11-0ubuntu27.3
Architecture: amd64
CasperMD5CheckResult: skip
CurrentDesktop: X-Cinnamon
Date: Sat Jul 18 17:54:10 2020
InstallationDate: Installed on 2013-10-11 (2471 days ago)
InstallationMedia: Ubuntu 13.04 "Raring Ringtail" - Release amd64 (20130424)
PackageArchitecture: all
SourcePackage: what-is-python
UpgradeStatus: Upgraded to focal on 2020-07-12 (5 days ago)

Question information

Language:
English Edit question
Status:
Expired
For:
Ubuntu what-is-python Edit question
Assignee:
No assignee Edit question
Last query:
2020-07-18
Last reply:
2020-08-05

This question was originally filed as bug #1888063.

Kai Kasurinen (kai-kasurinen) said : #1

there is no python2 version of pip, and no pip2 either on Ubuntu 20.04

Thank you for taking the time to report this issue and helping to make Ubuntu better. Examining the information you have given us, this does not appear to be a bug report so we are closing it and converting it to a question in the support tracker. We understand the difficulties you are facing, but it is better to raise problems you are having in the support tracker at https://answers.launchpad.net/ubuntu if you are uncertain if they are bugs. You can also find help with your problem in the support forum of your local Ubuntu community http://loco.ubuntu.com/ or asking at https://askubuntu.com or https://ubuntuforums.org. For help on reporting bugs, see https://help.ubuntu.com/community/ReportingBugs.

Kai Kasurinen (kai-kasurinen) said : #3

> I saw this error issued by pip:
>
> DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer > maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip, can be found at > https://pip.pypa.io/en/latest/development/release-process/#python-2-support

what is output of commands:
which pip
dpkg -S `which pip`
apt-cache policy python-pip python3-pip

Launchpad Janitor (janitor) said : #4

This question was expired because it remained in the 'Needs information' state without activity for the last 15 days.