Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ubuntu 16.04 LTS does not have Python 3.5.3 so can not run version 0.65 #13089

Closed
dns53 opened this issue Mar 11, 2018 · 17 comments
Closed

Ubuntu 16.04 LTS does not have Python 3.5.3 so can not run version 0.65 #13089

dns53 opened this issue Mar 11, 2018 · 17 comments

Comments

@dns53
Copy link

dns53 commented Mar 11, 2018

You dropped support for python 3.4 and have bumped the minimum version to Python 3.5.3
The currently supported long term support version of Ubuntu 16.04 comes with version Python 3.5.2 so I can no longer run home assistant on my up to date operating system.
Can you change the minimum python version down to 3.5.2 for the next few months until the next long term support version is released in one months.

@Danielhiversen
Copy link
Member

Danielhiversen commented Mar 11, 2018

@nmaggioni
Copy link
Contributor

nmaggioni commented Mar 12, 2018

@Danielhiversen the linked solution will just install Python 3.6 as python3.6, and python3 will still point to 3.5.2.

One could symlink /usr/bin/python3 to /usr/bin/python3.6 and have HomeAssistant (probably) working, but would risk severe and unpredictable problems with the rest of the distro's components that use compiled Python extensions. For example, apt is already known to have problems.

EDIT: HA fails to start for me with the given solution applied, no relevant logs.

@MartinHjelmare
Copy link
Member

Create a virtual environment first and specify the python version that should be used for the environment. Then install home assistant inside the environment. Then you don't need to change any system defaults.

@mrvanes
Copy link

mrvanes commented Mar 12, 2018

Another challenge is that the suggested PPA (deadsnakes) does not supply pip3 for python3.6 you have to curl some external stuff it seems, but I'm a bit weary that will break other stuff as it's not part of the package, I would execute that outside of a venv (feels like a catch-22).

@MartinHjelmare
Copy link
Member

That's not my experience. You don't need to install a specific pip3 for Python 3.6 before creating the environment.

@mrvanes
Copy link

mrvanes commented Mar 12, 2018

I know this is not the place to solve python venv problems, but this is what happens for me after installing python3.6 from the forementioned PPA:

# python3.6 -m venv test
Error: Command '['/opt/test/bin/python3.6', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1.

Found the solution:
https://stackoverflow.com/questions/43278420/pythonanywhere-python3-6-m-venv-test-results-in-error

@MartinHjelmare
Copy link
Member

You can use virtualenv and preferably also virtualenvwrapper, which are python packages, to create and handle virtual environments.

This is a nice guide and overview on python package management for Ubuntu:
http://chrisstrelioff.ws/sandbox/2016/09/21/python_setup_on_ubuntu_16_04.html

@trisk
Copy link
Contributor

trisk commented Mar 15, 2018

My virtualenv prefix is /opt/homeassistant and my HA instance runs as the user homeassistant with the config in the home dir (/var/lib/homeassistant/.homeassistant).
I was able to upgrade to Python 3.6 by replacing the existing virtualenv:

sudo add-apt-repository -y ppa:deadsnakes/ppa
sudo apt-get update
sudo apt-get install -y python3.6-venv python3.6-dev
# now start shell as homeassistant user with HOME set
sudo -u homeassistant -H -s
rm -rf /opt/homeassistant/*
python3.6 -m venv /opt/homeassistant
. /opt/homeassistant/bin/activate
# verify that the new venv has pip preinstalled
pip3 --version
pip3 install homeassistant

Then all I had to do was restart the service (in my case hass is started as /opt/homeassistant/bin/hass -c "/var/lib/homeassistant/.homeassistant").

@robbrad
Copy link

robbrad commented Mar 16, 2018

Thanks trisk - one small change

. /opt/homeassistant/activate to . /opt/homeassistant/bin/activate

@mad-ady
Copy link

mad-ady commented Mar 28, 2018

Does recreating the virtualenv pose any risk to the existing HA configuration (stored in ~homeassistant/.homeassistant) and other systems that depend on HA (like appdaemon)?
I'm using a different PPA for python3.6 which provides builds for armhf and arm64 as well

sudo add-apt-repository ppa:jonathonf/python-3.6
sudo apt-get update
sudo apt-get install python3.6 python3.6-venv python3.6-dev

Thanks

@trisk
Copy link
Contributor

trisk commented Mar 28, 2018

Does recreating the virtualenv pose any risk to the existing HA configuration (stored in ~homeassistant/.homeassistant) and other systems that depend on HA (like appdaemon)?

No, it does not affect the HA configuration.

@shaun-ba
Copy link

This is stupid, why would you break usage on the most widely used Linux OS? At least if you're going to do this provide a guide to a workaround for novice users.

Worse decision yet.

@Danielhiversen
Copy link
Member

@shaun-ba
I am sorry that you see it that way.
A quick google search, will give this guide: https://askubuntu.com/questions/865554/how-do-i-install-python-3-6-using-apt-get

@shaun-ba
Copy link

@Danielhiversen As 100s of people have said and comment on the forums etc this is not a valid workaround, installing a separate python version that does not replace the existing version is not a workaround, a lot more work is required for a novice user to get this running.

You've effectively wiped out 20% of your users, it's not "that I see it that way", it's clear from comments that it was a bad and premature decision to make, the next LTS release is this month if not already.

@c727
Copy link
Contributor

c727 commented Apr 23, 2018

what's the point of this discussion? 3.4 support won't come back and Ubuntu is not our primary platform...

@shaun-ba
Copy link

It's not a discussion, as you just say a bad decision was made and it won't now be reverted.

This is a great project, but attitudes like this towards novice users mean it won't be adopted as well as it could be.

@mad-ady
Copy link

mad-ady commented Apr 23, 2018 via email

@home-assistant home-assistant locked and limited conversation to collaborators Jul 26, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants