Hassbian python upgrade to 3.6

Python 3.4 support has been deprecated and will be removed in the beginning of 2018.
How can i upgrade python . Should i install fresh hassbian image or is there easy way to upgrade python ?

2017-12-28 22:11:26 WARNING (MainThread) [homeassistant.bootstrap] Python 3.4 support has been deprecated and will be removed in the beginning of 2018. Please upgrade Python or your operating system. More info: https://home-assistant.io/blog/2017/10/06/deprecating-python-3.4-support/

I have tried

Python 3.6 upgrade of a virtualenv

but follwing error

pi@hassbian:~ $ sudo apt-get install build-essential tk-dev libncurses5-dev libncursesw5-dev libreadline6-dev libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
build-essential is already the newest version.
libexpat1-dev is already the newest version.
libexpat1-dev set to manually installed.
libssl-dev is already the newest version.
zlib1g-dev is already the newest version.
zlib1g-dev set to manually installed.
The following extra packages will be installed:
  bzip2-doc fontconfig-config fonts-dejavu-core libfontconfig1 libfontconfig1-dev libfontenc1 libice-dev libsm-dev libtcl8.6 libtinfo-dev libtk8.6
  libutempter0 libxaw7 libxcb-shape0 libxcomposite1 libxft-dev libxft2 libxinerama1 libxmu6 libxpm4 libxss-dev libxss1 libxt-dev libxt6 libxv1 libxxf86dga1
  tcl tcl-dev tcl8.6 tcl8.6-dev tk tk8.6 tk8.6-dev x11-utils x11proto-scrnsaver-dev xbitmaps xterm
Suggested packages:
  db5.3-doc libice-doc liblzma-doc ncurses-doc readline-doc libsm-doc sqlite3-doc libxt-doc tcl-doc tcl-tclreadline tcl8.6-doc tk-doc tk8.6-doc mesa-utils
  xfonts-cyrillic
The following NEW packages will be installed:
  bzip2-doc fontconfig-config fonts-dejavu-core libbz2-dev libdb5.3-dev libfontconfig1 libfontconfig1-dev libfontenc1 libgdbm-dev libice-dev liblzma-dev
  libncurses5-dev libncursesw5-dev libreadline6-dev libsm-dev libsqlite3-dev libtcl8.6 libtinfo-dev libtk8.6 libutempter0 libxaw7 libxcb-shape0
  libxcomposite1 libxft-dev libxft2 libxinerama1 libxmu6 libxpm4 libxss-dev libxss1 libxt-dev libxt6 libxv1 libxxf86dga1 tcl tcl-dev tcl8.6 tcl8.6-dev tk
  tk-dev tk8.6 tk8.6-dev x11-utils x11proto-scrnsaver-dev xbitmaps xterm
0 upgraded, 46 newly installed, 0 to remove and 0 not upgraded.
Need to get 1,055 kB/10.1 MB of archives.
After this operation, 29.9 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Err http://mirrordirector.raspbian.org/raspbian/ jessie/main libxv1 armhf 2:1.0.10-1
  404  Not Found [IP: 93.93.128.193 80]
Err http://mirrordirector.raspbian.org/raspbian/ jessie/main libtinfo-dev armhf 5.9+20140913-1
  404  Not Found [IP: 93.93.128.193 80]
Err http://mirrordirector.raspbian.org/raspbian/ jessie/main libncurses5-dev armhf 5.9+20140913-1
  404  Not Found [IP: 93.93.128.193 80]
Err http://mirrordirector.raspbian.org/raspbian/ jessie/main libncursesw5-dev armhf 5.9+20140913-1
  404  Not Found [IP: 93.93.128.193 80]
Err http://mirrordirector.raspbian.org/raspbian/ jessie/main libdb5.3-dev armhf 5.3.28-9
  404  Not Found [IP: 93.93.128.193 80]
E: Failed to fetch http://mirrordirector.raspbian.org/raspbian/pool/main/libx/libxv/libxv1_1.0.10-1_armhf.deb  404  Not Found [IP: 93.93.128.193 80]

E: Failed to fetch http://mirrordirector.raspbian.org/raspbian/pool/main/n/ncurses/libtinfo-dev_5.9+20140913-1_armhf.deb  404  Not Found [IP: 93.93.128.193 80]

E: Failed to fetch http://mirrordirector.raspbian.org/raspbian/pool/main/n/ncurses/libncurses5-dev_5.9+20140913-1_armhf.deb  404  Not Found [IP: 93.93.128.193 80]

E: Failed to fetch http://mirrordirector.raspbian.org/raspbian/pool/main/n/ncurses/libncursesw5-dev_5.9+20140913-1_armhf.deb  404  Not Found [IP: 93.93.128.193 80]

E: Failed to fetch http://mirrordirector.raspbian.org/raspbian/pool/main/d/db5.3/libdb5.3-dev_5.3.28-9_armhf.deb  404  Not Found [IP: 93.93.128.193 80]

E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

I suspect the not found errors are due to the fact that you are still running the ‘Jessie’ version of raspbian. Since this is also out of date, you will need to upgrade this as well.

The best way to go about it depends on what else you have installed on the Pi. If the thought of having to re-install all the other things you have is not too bad, then you should re-install hassbian, which will get you raspbian ‘stretch’ version (the latest) and the correct version on Python.

I however, found the thought of re-installing was too much, and did a distribution upgrade, which worked out fine, although its not recommended on the Pi website.

There were several threads on the topic back last October-ish when the subject first came up, so its worthwhile looking back at them.

What do you recommend Reinsall Hassbian or install Hass.io

1 Like

That depends on how comfortable you are with hassbian.

hassio is intended for people who are not used to setting things up on the command line, and it seems to work for them. But if you have set hassbian up once already, it should be straightforward again.

I did the same thing 2 weeks ago - I used a spare SD card and downloaded the latest Hassbian image to that then copied over all my config.

Needed to follow Bruh to get Lets encrypt and DuckDNS working but Mosquitto will fail (do not try any other mosquitto installation method as you will leave old files on your device) - use this single command to install Mosquitto and don’t try the embedded MQTT client as it is hard work

sudo curl -o /opt/hassbian/suites/install_mosquitto.sh https://raw.githubusercontent.com/ludeeus/Tools/master/hassbian-config/hotfix/install_mosquitto.sh && sudo hassbian-config install mosquitto

There are scripts you can run here as well

https://github.com/home-assistant/hassbian-scripts

This will install python version 3.5.3 and not 3.6 but will suffice for now.

3 Likes