Python update

I also try my traditional way to upgrade home assistant but still receive one error and home assistant doesn’t start:
sudo apt-get update

sudo apt-get -y upgrade

sudo -u homeassistant -H -s
$ source /srv/homeassistant/bin/activate
$ pip3 install --upgrade homeassistant
$ exit

Command “/srv/homeassistant/bin/python3.7 -u -c “import setuptools, tokenize;file=’/tmp/pip-install-t0p54vig/MarkupSafe/setup.py’;f=getattr(tokenize, ‘open’, open)(file);code=f.read().replace(’\r\n’, ‘\n’);f.close();exec(compile(code, file, ‘exec’))” install --record /tmp/pip-record-nt998noe/install-record.txt --single-version-externally-managed --compile --install-headers /srv/homeassistant/include/site/python3.7/MarkupSafe” failed with error code 1 in /tmp/pip-install-t0p54vig/MarkupSafe/

Please help me…

I see you ran as user pi not user homeassistant. The propt you display indicates you did not follow the instructons exactly but it appears there are other issues.
I made the assumption that you initially installed the venv following the official instructions here . That installs the venv & HA as the user userassistant.
I also assumed you set up systemd to automatically start HA as the user homeassistant, as outlined in the documentation.

Step 12 failure indicates that your startup is set up differently.

What instructions did you follow initially to set up Home Assistant?

I don’t remember how I installed home assistant initially. Is that important?
There is one way to restore the installation? Now nothing is working.

the only things that i know is that I use this to update home assistant and in the past always work:

sudo apt-get update
sudo apt-get -y upgrade
sudo -u homeassistant -H -s
$ source /srv/homeassistant/bin/activate
$ pip3 install --upgrade homeassistant
$ exit

Thank you and regards.

I see you are running HA as the user homeassistant. That fits my method when run as that user.

How do you stop & start Home Assistant? We need to figure out why step 12 was failing.

When upgrading you should stop HA, upgrade, & then restart HA.

I newer start and stop home assistant but the upgrade always works.
I really want to use again home assistant but is not working. I also try to reinstall again dut i received always the same error:

Command “/srv/homeassistant/bin/python3.7 -u -c “import setuptools, tokenize; file =’/tmp/pip-install-t0p54vig/MarkupSafe/setup.py’;f=getattr(tokenize, ‘open’, open)( file );code=f.read().replace(’\r\n’, ‘\n’);f.close();exec(compile(code, file , ‘exec’))” install --record /tmp/pip-record-nt998noe/install-record.txt --single-version-externally-managed --compile --install-headers /srv/homeassistant/include/site/python3.7/MarkupSafe” failed with error code 1 in /tmp/pip-install-t0p54vig/MarkupSafe/

please help me…

When you reboot your server does Home Assistant start up automatically? If so, how?

When I reboot my raspberry home assistant started automaticly.

Now I don’t know what happened but after your instruction home assistant is not working.

There is one way to reinstall everithing and start again home assistant?

I want to keep raspbian and install home assistant. I’m not sure but I think that my situation was raspbian + virtual enviroment like docker or something like this.

Thank you.

Did you ever run Step 13? That step backed up your old Home Assistant/
I looked quickly and did not see that you did that.
Without knowing how HA was initially installed, I think the best approach right now is to use that backup, if it exists, to get Home Assistant back running.

Sorry, can you explain how run the step 13? Do you want me to start from the beginning until step 13?
I think I have no backup.
Anyway if I want to install again everithing?

I tried also this:


but at this point:
$ python3 -m venv .
i retreive this error:
Error: [Errno 1] Operation not permitted: ‘/srv/homeassistant/bin/activate’

Thanks, bosborne. With a little changes it worked very well for my raspbian-home assistant configuration. Note: It would be great to mention in the step 20a to run home assistant by run a command ‘run’.

There are only 2 official ways of installing Home Assistant in a venv. One is Hassbian but you did not to that. I assumed the other way documented here.

Apparently you did not follow those instructions when you initially installed. I think the best solution right now is to back up your configuration items and then reimage & reinstall.
For a venv, I would notmally back up a… /home/homeassistant to be sure I got the configuration in /home/.homeassistant and any other certificates, etc. I cannot advise because I do not know for sure where your configuration is stored.
Debian Buster is supposed to be released on July 6. I suspect the new Raspbian may be about the same time. They are supposed to come with the newer version of Python.

I back up the configuration in one folder and follow the instruction to install home assistant on a raspberry pi but again my problem start at this point:
$ python3 -m venv .
i retreive this error:
Error: [Errno 1] Operation not permitted: ‘/srv/homeassistant/bin/activate’

what I can do to continue the installation \ fix this problem?

thank you

Hassbian will get you a venv install easily.

https://www.home-assistant.io/docs/installation/hassbian/installation/

My question is this,
before I was able to run raspberry software and home assistant. This because I want to use rasppberry and some software inside for exaple teamwiever etc. and also home assistant.
There is a way to install again home assistant with a working raspberry?
Before yor instruction was working like this.

thank you

Hassbian should work like your old venv installation. They just add some scripts to make managing & upgrading easier.
For instance the Hassbian upgrade script for homeassistant stops HA, upgrades, & then restarts HA.

You apparently had a non-standard installation which makes it very difficult to support. Running something like Hassbian permits other here to help more effectively.

I have no idea about my installation. Now I think my installation is lost? I have saved the .homeassistant folder…I try to reinstall raspbian and home assistant and I hope something work…

The Hassbian image includes Raspbian & Home Assistant in a venv. and it will set things up to auto-start.
If you set up your own venv method you could end up again with a similar issue later.

Here are the official manual installation instructions for Raspbian Lite & a venv, if that is your choice.

By the way, a new install of stable Raspbian will still have the older Python. I think the Hassbian image has newer Python.

I try to explain better what I want and what was before.
Before I was able to run the raspbian software and also home assistant. Now I’m downloading the raspbian image, I want to start with a new raspbian and then install manualli home assistant. Is this possibile?

thank you