Update Python to the new version 3.9

[email protected]:/srv/homeassistant $ ls -ald
drwxr-xr-x 5 homeassistant homeassistant 4096 Nov 7 14:33 .
[email protected]:/srv/homeassistant $

That looks ok. Let’s try:

ls -al
df -i .
df -h .

[email protected]:/srv/homeassistant $ ls -al
total 24
drwxr-xr-x 5 homeassistant homeassistant 4096 Nov 7 14:33 .
drwxr-xr-x 3 root root 4096 Nov 7 14:33 …
drwxr-xr-x 2 homeassistant homeassistant 4096 Nov 7 14:33 bin
drwxr-xr-x 2 homeassistant homeassistant 4096 Nov 7 14:33 include
drwxr-xr-x 3 homeassistant homeassistant 4096 Nov 7 14:33 lib
-rw-r–r-- 1 homeassistant homeassistant 75 Nov 7 14:37 pyvenv.cfg
[email protected]:/srv/homeassistant $ df -i .
Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/sda1 1835008 189569 1645439 11% /
[email protected]:/srv/homeassistant $ df -h .
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 28G 5.9G 21G 23% /
[email protected]:/srv/homeassistant $

Looks like you have a venv there already

only because I tried to install home assistant and it failed

Not much more I can suggest to be honest. If that folder was empty before you ran pip then there’s no obvious issue in what you posted.

I will once again delete that VM and build yet another one and trying again
Thanks for responding I will post what I find if I muck my way through this issue

I was afraid of that answer :wink: In any case users should follow the best practice:

  • never update a stable running system when its ok for your needs
  • if developers urge you to do so :wink: alway keep a copy of your previous install

For now I am still tempted always to download the latest HA version until, maybe, my mysterious iPad bug Cannot load Web Frontend on one iPad
is resolved. Installing a new python version is a piece of cake compared to that :wink:

that is the advantage of running VM I can update a whole new machine without messing with my production machine until I am confident that it will work as intended

still the same error

[email protected]:/srv/homeassistant $ python3.9 -m venv .
Error: Command ‘[’/srv/homeassistant/bin/python3.9’, ‘-Im’, ‘ensurepip’, ‘–upgrade’, ‘–default-pip’]’ returned non-zero exit status 1.
[email protected]:/srv/homeassistant $

ok after mucking around in this whole thing it is apparently not a good idea changing the default of the python to the newer version when installing python3.8/3.9 Home assistant straight up does not like that it will not build the bin folder because it locks itself out of that the home assistant folder

but, why not?

Why would it?

Seriously, Docker is just another piece of software. It’s a way of running other software, but it’s just a piece of software. Why would using it for one thing then force you to run everything else with it?

built a copy and paste tutorial to install Python 3.9 that allows Home Assistant to install
This is intended for a Bare metal reinstall of your OS

Home Assistant Friendly Python 3.9

and if you used this tutorial to build your Home Assistant then it is real easy to copy all the Home Assistant files to another location and re paste them once you redo your Home Assistant with 3.9
nice and clean
Installing Home Assistant with File Sharing

It’s a container.
Once you go through the trouble of installing, configuring, monitoring and tuning a stack, it’s painless to adding additional containers.

:man_shrugging:

1 Like

I am using HA with Python 3.9 and one a week I have problem like this:

> Nov 19 14:16:07 server hass[8363]: OSError: [Errno 24] Too many open files
Nov 19 14:16:07 server hass[8363]: 2020-11-19 14:16:01 ERROR (MainThread) [homeassistant] Error doing job: socket.accept() out of system resource
Nov 19 14:16:07 server hass[8363]: Traceback (most recent call last):
Nov 19 14:16:07 server hass[8363]:   File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 164, in _accept_connection
Nov 19 14:16:07 server hass[8363]:   File "/usr/local/lib/python3.9/socket.py", line 293, in accept
Nov 19 14:16:07 server hass[8363]:     fd, addr = self._accept()
Nov 19 14:16:07 server hass[8363]: OSError: [Errno 24] Too many open files
Nov 19 14:16:07 server hass[8363]: 2020-11-19 14:16:01 ERROR (MainThread) [homeassistant] Error doing job: socket.accept() out of system resource
Nov 19 14:16:07 server hass[8363]: Traceback (most recent call last):
Nov 19 14:16:07 server hass[8363]:   File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 164, in _accept_connection

Is it cased by Python 3.9?

Good and simple procedure. Still having problem with mobile_app (Integration)
after upgrade . Do you know something about it ?

I use this guide for install in python 3.8.5 and work fine, and realy easy

Mi HA only stop for 1 minute

2 Likes

Thank you @igorlemos, just used this guide to update to python 3.9.0 on Raspberry Pi OS, as Python 3.7.3 was too old for homeassistant to run on, it seems to be working.

I’ve heard that using ./configure --enable-optimizations instead of ./configure results in Python running a little faster at the expense of a longer build time, but I’m not really sure if the difference will be noticeable on something like homeassistant