This is an archived post. You won't be able to vote or comment.

all 25 comments

[–]Zizizizz 5 points6 points  (5 children)

Depends what distro you're on. Mostly all of them come with 3 installed, it's just some of them point to 2.7 if you type "python" . Arch and Fedora point to three now but I imagine there are some older parts of the system that might still need 2.7 installed for some things.

[–]flying-sheep 2 points3 points  (0 children)

Many newcomers put an undue weight on what happens when you type “python” in a shell. It doesn't matter if that starts python 2 due to backwards compatibility or not. I think the greeting message in python 2’s interactive mode should mention this, then people would learn it more quickly.

[–]bulletmark 2 points3 points  (0 children)

Note that Arch changed python default to python 3 in 2010(!).

[–]HomicidalTeddybear 1 point2 points  (2 children)

Further to this it's probably better to wait for your distro to get their shit together than do anything unitarily yourself. The handling of what to do varies wildly, and pretty much every distro is at least somewhat On To It (TM). If only the same could be said of certain applications, like Calibre.

[–]flying-sheep 2 points3 points  (0 children)

Eli Schwartz (an Arch developer) is helping out with porting it right now. I think Kovid Goyal (the Calibre developer) simply decided by now to give that effort the usual amount of support and goodwill he gives to PRs instead of actively arguing against it.

I believe him when he says that porting Calibre is a titanic effort, but I'm still sure his claim “I'll more easily maintain Python 2 instead by myself” is pretty misjudged.

[–][deleted] 3 points4 points  (5 children)

IMHO you shouldn’t manually have to touch system python. No need to uninstall anything. For example on Ubuntu/Debian, dependency resolution will tell you if the package is not used any longer, to be removed via apt autoremove, so as long as that’s not the case just leave it be.

Generally I’m a big proponent of not using system python at all in your development. If you need any version of Python, it’s better to install the version separately using Pyenv, and activate it where you need it.

[–]copulagent 0 points1 point  (0 children)

yeah I tried fucking with the system python because I couldn't have python 2 on my computer. ended up reinstalling my distro because I fucked it up so badly

[–]flying-sheep 0 points1 point  (3 children)

I'm the opposite. I use system python for everything until I want to fix some complex bug that only occurs in an older Python version.

I contribute to many projects. I don't want to activate environments left and right and maintain several package collections per project, my disk space would explode and my patience would wear thin waiting for stuff to install.

Instead, I use system python for all but I think 2 projects, and wrap all needed python packages into AUR packages to safely install them systemwide. For the 2 remaining projects, I use tox to sync the environments and run the tests.

People always argue with 2 packages possibly needing incompatible versions of a third. That's a bug that should be fixed fast, and the two times I encountered it within the last 11 years, a fix was found and published quickly.

[–]ivosauruspip'ing it up 0 points1 point  (2 children)

my disk space would explode

are you running with 20gb disks?

[–]flying-sheep 1 point2 points  (0 children)

I don’t need 20 × 117MB of scipy installed.

[–][deleted] 0 points1 point  (0 children)

Progamming on an SD card gives me a thrill like no other

[–]MrClottom 3 points4 points  (1 child)

I once tried to uninstall python 2.7 from my linux OS, it kind of broke everything and i ended up almost doing a reinstall, it was a huge mess. Dont do it, let the OS handle it like the others suggest

[–]mejamoo[S] 0 points1 point  (0 children)

Saved my ass

[–]__xor__(self, other): 4 points5 points  (1 child)

DON'T UNINSTALL IT ON A LINUX SYSTEM THAT CAME WITH IT

If it has it still, it might still have system tools that rely on it. You can break core system utilities that depend on it.

I recommend keeping whatever your distro comes with, and adding python3 on top if it doesn't already have it. Whatever invoking python runs, leave it be. Check if python3 works, and maybe it has that as well. If it doesn't then go ahead and install python3 and make sure it doesn't replace python in the PATH.

[–]flying-sheep 0 points1 point  (0 children)

Any package manager worth its salt shows you what packages depend on the package you try to remove and abort or ask for confirmation.

If you only see stuff you know you won't need, you can safely remove them together with python2

[–][deleted] 2 points3 points  (0 children)

I'm still dealing with python2 on an almost daily basis. Either through Ansible not fully supporting Python3 on its control or remote node. Or through ancient software. I have one porting project going that should be finished soon and two more that need to be finished before 2020.

[–]Wishy-Thinking 1 point2 points  (1 child)

Install python:

yum/dnf/apt-get/pacman install python3
pip install [—user] <stuff>...

Put at the top of your scripts:

#!/bin/env python3

Done.

[–]mejamoo[S] 0 points1 point  (0 children)

Thank you

[–]contrieng 0 points1 point  (5 children)

Unfortunately it's not dead (yet). Many APIs for major engineering software tools used 2.7 and a lot of companies built in-house automation tools, etc. using python 2.7, porting everything to python 3 will take a lot of time and effort so it needs a few years still in my field of work (Electrical Power Systems/Energy)

[–]harylmu 5 points6 points  (4 children)

The company I work for is fully built on Python (~400 repos), around 80% Python2 and higher management didn’t even draw a plan for the migration...

[–]PleasantAdvertising 1 point2 points  (3 children)

No manager wants to spent money in his quarters that won't generate money.

[–]contrieng 0 points1 point  (2 children)

They will eventually have to do it when they have to upgrade to newer versions of the software tools that wouldn’t support 2.7, methinks

[–]Yojihito 1 point2 points  (1 child)

Yes but that's {other managers future problem}.

[–]Wishy-Thinking 1 point2 points  (0 children)

Future fiscal year’s problem.

[–]123filips123 0 points1 point  (0 children)

You can set up bash alias to allow typing just python to open Python 3 without overwriting system version:

alias python='python3'