Yesterday I’ve reinstalled Hass for the future with python 3.6. I’m using dietpi on a pine A64.
I’ve installed python 3.6 with following script:
#!/bin/sh
RELEASE=3.6.3
# install dependencies
sudo apt-get install libbz2-dev liblzma-dev libsqlite3-dev libncurses5-dev libgdbm-dev zlib1g-dev libreadline-dev libssl-
dev tk-dev
# download and build Python
mkdir ~/python3
cd ~/python3
wget https://www.python.org/ftp/python/$RELEASE/Python-$RELEASE.tar.xz
tar xvf Python-$RELEASE.tar.xz
cd Python-$RELEASE
./configure
make
sudo make install
sudo rm -rf ~/python3/Python-$RELEASE
cd ~
Then i’ve installed hass following the docs with virtualenv https://home-assistant.io/docs/installation/virtualenv/
Now i’ve added a commandline sensor with following command:
python -c "import requests; print(requests.get('https://pypi.python.org/pypi/homeassistant/json').json()['info']['version'])"
and it didn’t run everytime I’ve got an error
Now I found out what the problem was the command was run in the normal python environment and not in the virtualenv(in the normal env requests was not installed).
normally the command should be run in the virtualenv so somethings wrong but can’t find out what.
if I check the status of systemctl I get the following:
/srv/homeassistant/bin/python3.6 /srv/homeassistant/bin/hass