Deprecating Python 3.4 support

Starting with our next release, 0.55, we will deprecate Python 3.4 support. The current plan is to remove support for Python 3.4 at the beginning of 2018.

Python 3.5 was released on September 13th, 2015. It has since then become the default Python installation on the stable releases of Debian, Ubuntu, Raspbian and Hassbian. Our other own operating system, Hass.io, is more advanced and is already running the greatly improved Python 3.6.

The jump to Python 3.5 as a minimum version is driven by the Home Assistant core, which is based on asyncio. Starting with Python 3.5, asyncio got improved support in the language with dedicated keywords async and await. As this is the proper way of doing async in Python, we’re seeing a move by async libraries to either only support the new syntax from the beginning or dropping support for the Python 3.4 approach. Not moving along means an increased maintenance burden as we cannot use the latest releases of our libraries. Next to that it will prevent our users from being able to leverage the bug fixes and performance improvements that come with Python 3.5.

Hass.io

If you’re running Hass.io, you don’t have to do anything. Your system will always stay up to date.

Hassbian

If you’re running Hassbian it’s recommended that you make a backup of your configuration files and restore them on a fresh install. Upgrading an existing installation isn’t recommended.

Windows

If you’re on Windows, you’re fine as our minimum version for Windows has been 3.5 for a while now.

Other Debian based systems

If you’re running a Debian based system, follow these instructions to upgrade.


This is a companion discussion topic for the original entry at https://home-assistant.io/blog/2017/10/06/deprecating-python-3.4-support/

FYI for those that don’t follow HA on facebook. 0.64 will be the end of Python 3.4 support.

The time has come! Home Assistant 0.64, to be released in 2.5 weeks, will be the last version to support Python 3.4. More info here:

The more info here link points to the post above on the blog.

For anybody concerned about doing a major OS upgrade, or the challenges of getting all your apps working after a fresh install, it is possible to simply install a new version of Python, and then upgrade the venv. I’ve upgraded my old AIO install from Python 3.4 to 3.5, and then from 3.5 to 3.6 using these instructions.

It takes a couple of hours for the whole process if you’re on a Pi3, but the bulk of the time is in the preparing to upgrade stage.

5 Likes

Did anyone else notice that the home assistant blog now states that minimum python version supported will be 3.5.3?
Ubuntu 16.04 (currently the latest stable release) is still at 3.5.2…
(i.e. it is not up to date with debian stretch, which it is based on).

Is that going to be an issue for Ubuntu users (like me)?
The only way out Ubuntu users would be a manual install or go to a unstable release.
Unless of course Ubuntu releases python 3.5.3 just in time.

See: https://home-assistant.io/blog/2018/02/10/release-63/

Python 3.5.3 had some important asyncio fixes. As it is in Debian Stable, we decided together with the aiohttp team to go with that. Aiohttp is a big dependency of ours and they are already minimum 3.5.3 since the recently released v3.

For Ubuntu, the latest release has already the appropriate Python version. If you want to stick with Ubuntu LTS, a new release should arrive this year with a working Python version.

For older Ubuntus, have a look at this StackOverflow answer. It helps you to install Python 3.6 next to your existing Python 3 installation.

Apart from deprecating python 3.4 please also provide how to upgrade python to 3.6 for hassbian and other OS.

I tried to upgrade, installation ok. But I lost most of broadlink devices. o.O’

I thought the blog recommends copying configuration files and reimaging with latest hassbian. Upgrading current install is not recommended.

3 posts were split to a new topic: Broadlink devices missing since Python venv upgrade