Cannot reinstall HomeAssistant with pyenv Python Topic is solved

Having issues with your DietPi installation or found a bug? Post it here.
Post Reply
Bernie V
Posts: 18
Joined: Thu Jan 05, 2017 8:07 pm

Cannot reinstall HomeAssistant with pyenv Python

Post by Bernie V »

Hi,

When I tried to make a backup script for Home Assistant made a mistake and lost some files (Python and HomeAssistnat related) :roll: -> Home Assistant don't work anymore.

When I try to reinstall Home Assistant with dietpi-software reinstall 157 then I got an error: The Python ssl extension was not compiled. Missing the OpenSSL lib? So Python could not be installed

At this moment the openssl version is 1.1.1
openssl version
OpenSSL 1.1.1g 21 Apr 2020
I think that the install is suposing a lower version?

Below is the log of the reinstall. What can I do to recover Python and Home Assist?

Code: Select all

#### Details:
- Date           | Fri Jun  4 13:07:57 CEST 2021
- DietPi version | v7.2.3 (MichaIng/master)
- Image creator  | DietPi Core Team
- Pre-image      | Raspbian Lite
- Hardware       | RPi 2 Model B (armv7l) (ID=2)
- Kernel version | Linux VanDerMedPlay 4.19.66-v7+ #1253 SMP Thu Aug 15 11:49:46 BST 2019 armv7l GNU/Linux
- Distro         | stretch (ID=4,RASPBIAN=1)
- Command        | sudo -u homeassistant dash -c
. /home/homeassistant/pyenv-activate.sh
pyenv install 3.8.10
pyenv local 3.8.10
pip3 install -U pip wheel
[ -z '' ] || pip3 install
exec pip3 install homeassistant
- Exit code      | 127
- Software title | DietPi-Software

```
Downloading Python-3.8.10.tar.xz...
-> https://www.python.org/ftp/python/3.8.10/Python-3.8.10.tar.xz
Installing Python-3.8.10...
ERROR: The Python ssl extension was not compiled. Missing the OpenSSL lib?

Please consult to the Wiki page to fix the problem.
https://github.com/pyenv/pyenv/wiki/Common-build-problems


BUILD FAILED (Raspbian GNU/Linux 9 using python-build 20180424)

Inspect or clean up the working tree at /tmp/python-build.20210604125011.7473
Results logged to /tmp/python-build.20210604125011.7473.log

Last 10 log lines:
         ./python -E -m ensurepip \
                $ensurepip --root=/ ; \
fi
Looking in links: /tmp/tmptuh0woss
Processing /tmp/tmptuh0woss/setuptools-56.0.0-py3-none-any.whl
Processing /tmp/tmptuh0woss/pip-21.1.1-py3-none-any.whl
Installing collected packages: setuptools, pip
  WARNING: The scripts pip3 and pip3.8 are installed in '/home/homeassistant/.pyenv/versions/3.8.10/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed pip-21.1.1 setuptools-56.0.0
pyenv: version `3.8.10' not installed
dash: 5: pip3: not found
dash: 7: exec: pip3: not found
User avatar
Joulinar
Posts: 4783
Joined: Sat Nov 16, 2019 12:49 am

Re: Cannot reinstall HomeAssistant with pyenv Python

Post by Joulinar »

Hi,

I see you are running old Debian Stretch. Would it be an option to update to Debian Buster? Or do you like to stay on Stretch? Because Stretch is a death end road and will become oldold soon, once Bullseye has been released. https://en.wikipedia.org/wiki/Debian_ve ... ease_table
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Bernie V
Posts: 18
Joined: Thu Jan 05, 2017 8:07 pm

Re: Cannot reinstall HomeAssistant with pyenv Python

Post by Bernie V »

Hi, I really like to upgrade but first It would be nice that Home Assistant is running again.

btw: Is an inplace upgrade possible?
User avatar
Joulinar
Posts: 4783
Joined: Sat Nov 16, 2019 12:49 am

Re: Cannot reinstall HomeAssistant with pyenv Python

Post by Joulinar »

Is an inplace upgrade possible?
Basically yes, but something not official supported 8)

Before running the update, do a full backup (better to clone the SD card) to be on save side. viewtopic.php?p=18988#p18988

Regarding HA I can run some test, just need to pull an old Stretch image from somewhere :)
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Bernie V
Posts: 18
Joined: Thu Jan 05, 2017 8:07 pm

Re: Cannot reinstall HomeAssistant with pyenv Python

Post by Bernie V »

Thx for the link.
So I f consider an inplace upgrade and this works than I need to do a dietpi-software reinstall 157 again? Hoping then that HA comes back alive with python?
User avatar
Joulinar
Posts: 4783
Joined: Sat Nov 16, 2019 12:49 am

Re: Cannot reinstall HomeAssistant with pyenv Python

Post by Joulinar »

That would be the best case scenario. :)

But do a backup before, whatever you do
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Bernie V
Posts: 18
Joined: Thu Jan 05, 2017 8:07 pm

Re: Cannot reinstall HomeAssistant with pyenv Python

Post by Bernie V »

Home Assistant is back online. Up and running on Buster ;) .
I wanna thank you for your support!

I will do the same inplace upgrade with my other DietPi RPi.

Thx!
User avatar
Joulinar
Posts: 4783
Joined: Sat Nov 16, 2019 12:49 am

Re: Cannot reinstall HomeAssistant with pyenv Python

Post by Joulinar »

perfect. Now you are ready for Bullseye which most probably will be released this summer ;)
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Post Reply