4 ms·
As a development lead, we recently abandoned our plans to migrate to Python 3. Here's a short summary of why: To begin the migration, we needed to move from Py
by falcolas 13y ago
As a development lead, we recently abandoned our plans to migrate to Python 3. Here's a short summary of why:
To begin the migration, we needed to move from Python 2.6 (which is the default on our CentOS6 production boxes) to Python 2.7. This transition is actually rather hard. We can't use the packages provided in CentOS base or EPEL, because they are all complied against Python 2.6. To re-produce all of our package requirements would require us to either build new packages of the compiled libraries (such as MySQL-python, python-crypto, PyYAML, etc), or load down our production environment with a compiler and all of the development libraries.
Migrating from Python 2.7 to Python 3 would have required a nearly identical effort (there's not a lot of Python 3 packages for CentOS, in particular the packages that we need for our application).
Frankly, it's just not worth that effort at this time. Python 2.6 is the default environment, there's solid package support for it, and it just plain works. We'll make that dive when Python 3 becomes the default for CentOS (scheduled for 8 or 9, IIRC), and probably not before.
- devicenull 13y agoUsing Python2.7 on CentOS really isn't that hard. Install FPM, and run `fpm --python-bin python2.7 --python-easyinstall easy_install-2.7 -n MySQL-python27 -s python -t rpm -d python27 MySQL-python` . You'll find a MySQL-python27 RPM sitting in the current directory. Repeat for any package you want. You can avoid compiling the core python27 language yourself by using the python27 packages from IUS.
- falcolas 13y agoYou just described building packages, which we looked into and decided not to do. The cost (which does not stop after the rather easy step of building the packages) was not offset by the benefit of migrating.
- marcosdumay 13y agoEven Debian is using Pyhon 2.7 for a while already, looks like CentOS is being quite slow.
- falcolas 13y agoWhen you consider what it is, it makes sense. It's designed for big companies that want stability, at the cost of being a few OS generations behind the bleeding edge. Fedora is moving to Python 3, so RHEL (and thus CentOS) will follow, but not for several years.
- laurencerowe 13y agoPython has been a pain on RedHat and derivatives for as long as I can remember. The problem is simply down to the decision to package only a single Python version. On Debian and derivatives you've been able to install distribution packages of multiple python versions (e.g. python2.4 and python2.7) at the same time. You lose all the advantages of a long maintained stable distribution when you have to install a bunch of hand-compiled packages.
- SwellJoe 13y agoCentOS keeps the same major version of everything through the entire life of the OS; so, five years plus two more for vital security updates. This is by design, and a completely reasonable choice. Often, you can install additional packages that bring newer versions into the system, but they don't become the "default". So, for PHP in CentOS 5, there was a php53 package (and maybe later ones, too, I dunno), that installed alongside the standard php package and didn't break compatibility but gave users the option of using a newer PHP version. I'm pretty sure Python 3 is available in CentOS repos (it certainly has been in Fedora repos for a long time). It's just not the default system Python you get when you type "python".
- yxhuvud 13y agoIt is a reasonable choice until the day when you get hacked because you use a prehistoric version of something that doesn't get security updates anymore. Sure, sometimes that will get backported security fixes, but that is not always possible. Heck, sometimes the installation depends on said security hole.
- 13y ago
- bcj 13y agoOur company moved from CentOS to Gentoo and we were able to drop support for 2.6. We're now (mostly) 3-compatible and are rolling out our first 3.3-based production server. We've definitely been lucky, I wish the transition had been easier for everyone.
- giovannibajo1 13y agoCan you elaborate why you need to use a version shipped with the distro instead of simply using virtualenv+pip to install all third party dependencies?
- itsadok 13y agoUsing a binary package with pip requires "a compiler and all of the development libraries", which GP said he doesn't want to do. Personally I gave up a while ago and now I do "apt-get build-essential python-dev" on every new server, but it's not ideal. I really like the approach outlined in https://hynek.me/articles/python-app-deployment-with-native-packages/ https://hynek.me/articles/python-app-deployment-with-native-... , but haven't gotten around to implementing it.
- PopsiclePete 13y agoLinux is the new Windows XP. "We can't install that web app, we are standardized on IE6 and WinXP until 2035 or the Second Coming, whichever comes first".
- sixbrx 13y agoMake that just "the new Windows" and I'd agree. There's plenty of standardizing on "Server 2003" and other Windows versions, that didn't stop with XP. Or, in other words, both platforms have firms that like to standardize on particular versions for stability. Which isn't really much of an attribute of Windows or Linux themselves, really.
- sciurus 13y agoDid you look at software collections? I don't know what the state of repackaging them from RHEL for CentOS is, but they're Red Hat's supported means for using Python 2.7 or 3.3. http://developerblog.redhat.com/2013/09/12/rhscl1-ga/ http://developerblog.redhat.com/2013/09/12/rhscl1-ga/
- lmm 13y ago> Frankly, it's just not worth that effort at this time. Python 2.6 is the default environment, there's solid package support for it, and it just plain works. We'll make that dive when Python 3 becomes the default for CentOS (scheduled for 8 or 9, IIRC), and probably not before. Which is well and good; there's no point fighting with your operating system. Python3 was always going to be a slow migration; perhaps it's going even slower than planned, but that's not the disaster the OP portrays (in fact it sounds like you'd have just as much trouble migrating to python 2.7 as python 3, so there's no python3-specific problem here). Python3 is now at a place where distributions are adopting it as default; non-bleeding-edge folks will follow their distribution's lead.