10 ms·
I think you're exaggerating the obscurity of libraries that only run on python 2. The list I've gone off of is https://python3wos.appspot.com/ https://python3w
by dcosson 11y ago
I think you're exaggerating the obscurity of libraries that only run on python 2.
The list I've gone off of is https://python3wos.appspot.com/ https://python3wos.appspot.com/. I use python a lot, and only now in late 2015 I might finally use python3 if starting a new project. When I started a new project last year, we used python2.
The biggest hold-out for me was gevent, which was only released 5 months ago. Gunicorn with gevent workers is my preferred stack for running python apps.
If you use protobufs or thrift, those both aren't yet on python3.
The wall of shame currently lists requests as not working on python3, though I think that might be a fluke.
These ones might not be a deal-breaker since you can have a separate environment for infrastructure & app code, but for some reason a lot of the infrastructure tools still haven't updated to python 3 (supervisor, ansible, fabric, graphite).
All together, it adds up to a not-insignificant number of things that aren't yet on python3. And even if nothing you use when you first start a project is python2 only, you have no idea what libraries you might need or want in the future and if those might be python2 only.
- zardeh 11y agoprotobuff supports 3.0 (though apparently the pip3 version still requires you to manually run 2to3, but then it works) and there's already a port of fabric (ish) by the original author to py3. And Ansible should be python2 until distros start shipping py3 by default, (which they have so I assume Ansible3 will come out soonTM). If you're willing to do a bit more than "pip install x", well I guess it doesn't work, back to py2, you can use almost everything on py3. (and yes requests is ported too)
- netheril96 11y agoA freshly ported library of nontrivial size will include many bugs, especially if the porting is done automatically. Not a risk worth taking.
- e1ven 11y agoThat's fair. I only have my experience to draw from, but I've personally found it very straight forward. Gevent said it looks like they're supporting Python3 as of the 1.1 release - http://www.gevent.org/whatsnew_1_1.html http://www.gevent.org/whatsnew_1_1.html I've used requests with Python3 quite a bit.. I have no idea why it's not listed as supported on the WoS, but their page shows it as working since 2012. https://pypi.python.org/pypi/requests/ https://pypi.python.org/pypi/requests/ Protobugs looks like it's now Py3 compatible, per the devs- https://github.com/google/protobuf/issues/646 https://github.com/google/protobuf/issues/646 ThriftPy has supported Python3 for a while (although ThriftPy is slower than the official lib). Apache Thrift has recently begun working with Python3 as well, however (https://issues.apache.org/jira/browse/THRIFT-1857 https://issues.apache.org/jira/browse/THRIFT-1857) I run Ansible/etc in their own virtualenvs, so they aren't part of system python for me, but you're right - I did have to write an Ansible module recently, and I recall that I did have to use Py2. The only major package I recall having a problem with was PIL - Eventually I moved to Pillow as a drop-in replacement.
- jackmaney 11y agoI wouldn't really trust the "Python 3 Wall Of Superpowers", as it doesn't appear to be anywhere near current. The first listed example of a 3.x incompatible package is requests[1], which is not only compatible with 2.7--3.4[2], but has been 3.x compatible since 2012-01-23[3]. [1]: http://docs.python-requests.org/en/latest/ http://docs.python-requests.org/en/latest/ [2]: http://docs.python-requests.org/en/latest/#feature-support http://docs.python-requests.org/en/latest/#feature-support [3]: https://pypi.python.org/pypi/requests https://pypi.python.org/pypi/requests
- stared 11y agoIt's not only only about big libraries. Unless you do web-dev and can rally only on the currently developed libraries, from time to time you will get a specific, abandoned library. Even if there is just a single such library, Python 2.7 may be preferable. Moreover, in machine learning Python 2.7 is still considered the default version of Python. (E.g.: some part of OpenCV need Python 2.7; until recently Spark supported only Python 2.7.)