Release of IPython 5.0

IPython 5.0-LTS is out!

We are pleased to announce the release of IPython 5.0 LTS (or Long Term Support). IPython is the Python kernel for Jupyter and the interactive Python shell; it provides a rich set of features for fluid interactive computation in Python at the terminal, in the Jupyter Notebook and across all other clients that support the Jupyter architecture.

This release has some exciting new features and lots of new development (227 commits by 27 contributors over 191 PRs). Most importantly, there have been significant improvements to the classic IPython command line interface.

As usual you can try this new release with:

pip install ipython --upgrade

The package should also be available through conda and other package managers in the next few days.

Note: IPython is now developed under the umbrella of the broader Project Jupyter, but like other components of Jupyter, with its own independent schedule. Therefore, this release does not impact the Jupyter Notebook, Qt Console, nbconvert, or other packages that were formerly part of IPython.

A brand new terminal interface

Decoupling IPython from the Jupyter Notebook package has allowed the core team to focus on improving the command line interface independently of the notebook. The awkward dependencies on pyreadline for Windows and gnureadline for Mac prompted Thomas Kluyver to replace the old machinery with a brand new pure-python readline replacement: prompt_toolkit.

The prompt_toolkit package is an amazing library from Jonathan Slenders and recently reached version 1.0. Going beyond readline, prompt_toolkit provides many advanced features for editing text in the terminal that significantly improve the user experience. Since it is a cross-platform library, all our users on Linux/Unix, macOS and Windows benefit from these improvements. Thanks to prompt_toolkit, IPython now supports:

  • Syntax highlighting as you type
  • Real multi-line editing (up and down arrow keys move between lines)
  • Multi-line paste without breaking indentation or immediately executing code
  • Better code completion interface (we plan to improve that more)
  • Optional mouse support

screenshot showing IPython 5.0 on a light background terminal with syntax highlighting and completion open

We're not using all of the features of prompt_toolkit yet, but after working with it for a few weeks, it already feels strange to go back to older versions of IPython without these improvements. We are hopeful that you will enjoy them. We’re extremely grateful to Jonathan Slenders, who has been super responsive with all our questions and feature requests!

You can get a more detailed list of changes to expect by reading the "What's new in IPython 5.0" document.

Jupyter Console

The Jupyter Console provides the interactive client-side experience of IPython at the terminal, but with the ability to connect to any Jupyter kernel instead of only to IPython. This lets you test any Jupyter Kernel you may have installed at the terminal, without needing to fire up a full-blown Notebook for it. The Jupyter console gained also most of the functionality described above and also makes use of prompt_toolkit.

A few days ago we released Jupyter Console 5.0 as well, which brings compatibility with IPython 5. If you are a Jupyter Console user you will need to upgrade as well.

$ pip install jupyter_console --upgrade

Long Term Support (LTS)

You might have picked this up from the title of this blog post: IPython 5.x will be the first release series to get Long Term Support (hence the LTS name).

With IPython, we usually only offer support for a single major release at a time; once a new major release comes out, previous major releases stop getting bug fixes. For the 5.x series releases we are making an exception to that rule: until the end of 2017 the core team will do its best to provide fixes for critical bugs in the 5.x release series. Beyond that, we will deprioritise this work, but we will continue to accept pull requests from the community to fix bugs through 2018 and 2019, and make releases when necessary.

We hope that this will help organisations that need long term support for IPython version 5.x.

End of support for Python 2

IPython has been compatible with Python 3 for several years, since Thomas Kluyver ported the codebase to be Python 3 compatible using 2to3 in 2011, and we moved to a single-source codebase for Python 2 and 3 in 2013. The day to day development of IPython is now completely done using Python 3, and we're starting to accidentally break Python 2 compatibility until tests or users flag it. We're also keen to use many of the new Python 3 features, such as type annotation, yield from, asyncio, async def, await and other improvements the language and its standard library have gained in recent years.

We have therefore decided that IPython 5.x will be the last major version to support Python 2.

This is, of course, why we are planning to support IPython 5.x for much longer than usual. We recognise that many people still use Python 2, and they will be able to continue with a supported version of IPython for several years, and transition at a time that suits them. Beyond the end of 2017 we are willing to provide minor bug fix releases in the 5.x with community contributed patches. Most importantly, no new features will be added to a Python 2 supported IPython beyond the upcoming 5.0 release.

Thus, the next major version of IPython, IPython 6.x will require Python 3. It will start to make use of new syntax, and shed the compatibility layer we have in place.

If you are a Python 2 user, be reassured, we will make sure that upgrading does not unexpectedly install IPython 6.x and break your system. You can decide to stay for a longer period of time on IPython 5.x LTS and decide to leapfrog a few IPython versions once you migrate to Python 3, though we recommend keeping up to date with the latest stable versions as they are released, and of course to migrate to Python 3 when possible.

IPython is the first IPython/Jupyter project to drop support for Python 2, but you can expect other components of IPython/Jupyter to follow. Since its inception, JupyterHub for example as always been Python 3 only.

It is important to note that users will always be able to use a Python 2 kernel with the Jupyter Notebook, even when all of our projects have transitioned to Python 3: as part of our LTS commitment, we will make any necessary updates to the IPython kernel so it can continue to work in a Jupyter Notebook for the duration of our LTS support.

Help us with the Python 3 transition

We understand that migrating to Python 3 can be difficult for various reasons, and that planning ahead is often necessary. For this reason we are helping to gather a non-exhaustive list of projects that have decided to drop support for Python 2 in or before 2020, when support for Python 2.7 itself ends. Projects such as Matplotlib and SymPy plan to drop support in the next few years, while a few projects like Scikit-Bio are already ahead of us, and should be Python 3 only soon.

Thus we decided to sign the Python3 Statement that lists projects that are taking this step, as well as – when possible – provide a planned release schedule for which versions will still be Python 2 compatible, and which versions will be Python 2 only.

If you’d like to add your project to this page, or you know a project that’s thinking about the Python 3 transition, please get in touch there. We believe that giving enough information to Python users as early as possible will help ease the transition.

See you at SciPy!

Some of us will be at SciPy this year in Austin. We’ll be happy to meet with you, and hopefully run sprints on IPython and Jupyter projects. We hope to see you there.

[Update] Friday July 8, 11 Pacific

Hackernews and Reddit threads