Should it be possible to remove python 2.7 from Pi running buster?

Python 2.7 went out of support at the beginning of 2020, is it now possible to remove it from buster installations?

--
Chris Green
Reply to
Chris Green
Loading thread data ...

On Tue, 29 Dec 2020 21:59:18 +0000, Chris Green declaimed the following:

Not really...

formatting link
""" Debian 10 will continue to support Python 2 until the end of support for Buster. """

formatting link
""" Debian Bullseye contains 2.7, 3.7, 3.8 """

formatting link
""" I hear there will still be a Python 2 interpreter in bullseye, can I use that in my package?

No you can't. From #975014:

Debian Bullseye includes a version of Python 2.7 (and a short list of related packages like setuptools still built Python 2 packages). However, these are only included for building a few applications which still require Python 2 as part of their build process. Python 2 is not supported for running applications and there won't be any security updates for Python

2 in Bullseye. """
--
	Wulfraed                 Dennis Lee Bieber         AF6VN 
	wlfraed@ix.netcom.com    http://wlfraed.microdiversity.freeddns.org/
Reply to
Dennis Lee Bieber

Check whether you haven't got any Raspbian packages that use Python 2.7 and no other Python programs from 2rd parties or written by yourself.

If you don't have any of these dependencies it can be removed.

To search for them:

- if you write Python, grep your local source files for strings unique to Python 2.7 such as library functions used by 2.7 and not by 3.7

- running "apt-get --no-remove autoremove" should report any packages that were installed to satisfy dependencies without removing them. **** caution I've not tried this, but its documented in the apt-get **** manpage.

--
--   
Martin    | martin at 
Gregorie  | gregorie dot org
Reply to
Martin Gregorie

Yes, this is what I assumed would be true but I just wanted to check that there aren't any system dependencies on Python 2.7.

I moved and/or converted all my Python code to Python three a while ago.

Well one can simply do "apt remove python2.7" and see if it removes anything significant with it (apart from the associated libraries of course, which should go). You only have to say "N" when it asks if you want to continue so it doesn't then do the removal.

--
Chris Green
Reply to
Chris Green

when I installed software from Adafruit for an audio hat (actually their Voice Bonnet) it issued a warning that is was going to change the default system python to Python3, so fare I have experienced no issues this may be a safer way to conver to python3 as python2 is still available if needed.

--
The system will be down for 10 days for preventive maintenance.
Reply to
alister

Why bother? Let the distro packagers do it when they consider it safe.

Reply to
Pancho

But they won't. If you have python2.7 installed it will simply stay there for ever unless you remove it yourself explicitly.

It's like if you have any 'top level' program installed, it will stay there until you remove it. Python 3.x isn't a new version of Python

2.7, it's a different/new program.

Python 2.7 would probably disappear if you upgrade to the next version of Raspbian/Debian.

--
Chris Green
Reply to
Chris Green

Thats the current position for Fedora: now that Fedora 33 is out. This laptop is running F32, which I'll be upgrading to F33 later in January. It still has Python 2 software installed but there are no longer any Python 2 packages in its package library.

But, although all distros will stop support for Python 2 at a similar time, the exact timing for each distro will depend on the speed at which packages that contain Python are upgraded from 2 to 3 by its package maintainers. I'm not surprised if Fedora is doing it before Raspbian since its a bit more on the bleeding edge than Raspbian or Debian are.

--
--   
Martin    | martin at 
Gregorie  | gregorie dot org
Reply to
Martin Gregorie

It won't, a quick check shows Debian Bullseye contains 2.7, but that is what I meant, eventually 2.7 will disappear in a new release.

Reply to
Pancho

Doubtful. I actually just cleaned over 100 packages from my Debian 10 desktop that were from Debian 9. They may have come from quite a few versions ago since they weren't exactly familiar. Many were libraries with no dependencies. Part of the upgrade process actually is this kind of cleanup but I at least have been slacking. According to aptitude search '~o' I still have a bunch of packages marked obsolete but at least about a quarter of them are the transitional dummy kind so actual content taking space is negligible.

Reply to
Anssi Saari

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.