DEV Community

rhymes
rhymes

Posted on

Are you still using Python 2?

Are you still using Python 2.7?

If so, why?

Do you know Python 3 is 10 years old?

A lot has changed since the early days of Python 3.0, today most frameworks and libraries either support both, have dropped Python 2 or are about to do so.

Python 3 is better than Python 2 (and is about the same speed). Also Python 2 is not going to be maintained at all by 2020 and has been in feature freeze for a long time (since 2010 I think).

If you are still using Python 2.7 daily at work without a plan to migrate in sight, please talk about it internally. If the reason, for you being stuck at work on Python 2, is a specific third party library that hasn't been migrated so far, please ask your company to actually fund the open source project so they can migrate ;-)

Python has been around for 27 years, Python 2 18 years, Python 3 10 years and the Python community is bigger than ever. The investment in Python 3 is definitely worth it.

Let's talk about it and if you need help to make the decision I think I can help.

Latest comments (43)

Collapse
 
s0fty profile image
Softy

I used it on a bot project in its beginning until I faced some issues with Python 2. Python3 is way WAY better.

Collapse
 
rhymes profile image
rhymes

What sort of issues did you face?

Collapse
 
rhymes profile image
rhymes

Here's there an interesting story on how Python 3 went from non-existent to practically the dominant version at Facebook in 4 years: lwn.net/SubscriberLink/758159/f1f6...

Collapse
 
santosh profile image
Santosh Kumar

Not able to install PySide2 on Python 3. Using Anaconda. PySide is not compatible for Python 3. At last ended up using PySide on Python 2.

Collapse
 
rhymes profile image
rhymes • Edited

I've never used PySide2 but apparently it's supposed to work on Python 3 as well: wiki.qt.io/Qt_for_Python/GettingSt... - Maybe check the mailing list to see, the wiki talks about issues with Python 3.6.0 but we're at 3.6.6 and 3.7.0

PySide 1 is definitely deprecated according to the website so I wouldn't worry about it being compatible with Python 3

Collapse
 
cesartavo profile image
CesarTavo

I tried to change to python 3.6.5 because I have 2.7,
But I didn't know that cinnamon use python 2.7 and when I erased all 2.7 cinnamon stopped and all their applications didn't work.

Now, I installed python 3.6.5 but I still have 2.7,

I read that you recommend to use pyenv to use python without touching the default environment. I going to try that.

I use Slackware Linux.

Collapse
 
rhymes profile image
rhymes

Yeah, I definitely recommend pyenv. You can keep your packages on 2.7 and try 3.6 or 3.7 alongside with it.

pyenv is independent from the distro packaging system

Collapse
 
defman profile image
Sergey Kislyakov

Not all codebases could be migrated to Python 3 yet have more benefits from it (time, bug fixes, etc.). And about security issues... Should I be worried about that if my application is offline completely?

Collapse
 
rhymes profile image
rhymes

What do you mean by completely offline?

Like a desktop application or a script not connected to the internet or an app on an offline computer?

Collapse
 
defman profile image
Sergey Kislyakov

A desktop app that does not require internet at all.

Thread Thread
 
rhymes profile image
rhymes

Well, then no. If you don't require new language features and you can be reasonably sure there are no language bugs you require to be fixed then you can stay on Python 2 lane.

Just make sure, if it's an app that is going to be improved for the years to come, that any framework you use as a plan for the future. Maybe the language won't be an issue but what if the particular desktop framework you use has forked a new version for Python 3 and stopped developing the version for 2?

In the beginning most people didn't migrate because frameworks were not ready for Python 3, now a lot of frameworks plan to remove support for Python 2. Django 2 is Python 3 only, for example.

Collapse
 
jannisfink profile image
Jannis Fink

I'm currently working in the PLM/ERP field, where currently almost every customer has it's own on-premise installation with (sometimes) thousands of lines of customizing (the biggest one I know of has a size of about 300kLOC). Migrating all these installations to work with python3 is a huge effort. So management/CTO hesitated to drop python2 support so that customers could update their installations without having to migrate their code.

Right now, we plan to make the cut with the next major release (due early 2019, if I remember correctly) while providing long term support for the current one, even after 2020.

Collapse
 
rhymes profile image
rhymes

Good luck for the next release! Sounds like a solid plan!

Collapse
 
jvlppm profile image
João Vitor P. Moraes • Edited

Using the command python3 feels to me like I am still using a preview version, and 'python' command defaults to python 2.

Maybe more people feel the same, but I haven't used python lately, sorry xD

Maybe the reason

Collapse
 
rhymes profile image
rhymes

Using the command python3 feels to me like I am still using a preview version, and 'python' command defaults to python 2.

Eh eh, a preview version that's 10 years old ;)

If you want to experiment with Python without touching OSX default version (which I recommend anyway) you can check out pyenv

Collapse
 
bgadrian profile image
Adrian B.G.

Non python developer here

reading

Collapse
 
rhymes profile image
rhymes

hahaha one of my favorite gifs ever :D

Collapse
 
pierrefaniel profile image
Pierre Faniel

I work with an ERP called Odoo which has been based on Python 2.7 since its first version. It only switched to Python 3 since last version which was released last year. The main issue faced is that it is very time costly to migrate from one Odoo version to another when there are custom made module on top of the base ERP solution. Most customer don't really see the benefit of switching to the newest Odoo version nor python and no one will do it for free sadly.

So I believe they're going to stick with decommissioned Python 2.7 after 2020. Hard to explain the benefit of updates when there is money at stake...

Collapse
 
rhymes profile image
rhymes

I understand perfectly. ERP products are hard to migrate.

Most customer don't really see the benefit of switching to the newest Odoo version nor python and no one will do it for free sadly.

Well, if they new Odoo version does not offer anything compelling to them then... the customer is always right, no debating on that :D

So I believe they're going to stick with decommissioned Python 2.7 after 2020. Hard to explain the benefit of updates when there is money at stake...

You can monitor the changes since the 11 version and see if they start implement features which will improve your customers modules and/or justify the migration.

Still, getting familiar with Python 3 is worth it anyway (even for professional reasons as a Python developer)

Collapse
 
pierrefaniel profile image
Pierre Faniel

Oh yeah, I definitely prefer to work with Python 3!

Yeah, I hope they come up with great new features that will justify migrations!

Collapse
 
rhymes profile image
rhymes

Upgrading is not worth it when the systems work fine on 2.7.

I agree if it's internal tools and system software. I disagree if any of it is customer facing.

2020 is not that far away and having no support nor security fixes could be troublesome down the line.

BTW Python 3.7 was released yesterday :P