Error after updating home assistant and python

Hya,

under notification i got the following:

Python version
Support for the running Python version 3.7.3 is deprecated and will be removed in the first release after December 7, 2020. Please upgrade Python to 3.8.0 or higher.

and i’m also getting the following errros:

2020-11-01 13:24:38 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up upnp platform for sensor
Traceback (most recent call last):
  File "/var/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 197, in _async_setup_platform
    await asyncio.shield(task)
  File "/var/homeassistant/lib/python3.7/site-packages/homeassistant/components/upnp/sensor.py", line 93, in async_setup_entry
    device: Device = hass.data[DOMAIN][DOMAIN_DEVICES][udn]
KeyError: 'uuid:upnp-InternetGatewayDevice-192168801298900001'
2020-11-01 13:24:38 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up upnp platform for sensor
Traceback (most recent call last):
  File "/var/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 197, in _async_setup_platform
    await asyncio.shield(task)
  File "/var/homeassistant/lib/python3.7/site-packages/homeassistant/components/upnp/sensor.py", line 93, in async_setup_entry
    device: Device = hass.data[DOMAIN][DOMAIN_DEVICES][udn]
KeyError: 'uuid:upnp-InternetGatewayDevice-192168801298900001'
2020-11-01 13:24:38 INFO (MainThread) [homeassistant.bootstrap] Home Assistant initialized in 12.45s
2020-11-01 13:24:38 WARNING (MainThread) [homeassistant.bootstrap] Support for the running Python version 3.7.3 is deprecated and will be removed in the first release after December 7, 2020. Please upgrade Python to 3.8.0 or higher.
2020-11-01 13:24:38 INFO (MainThread) [homeassistant.core] Starting Home Assistant
2020-11-01 13:24:38 INFO (SyncWorker_49) [homeassistant.components.zeroconf] Starting Zeroconf broadcast
2020-11-01 13:24:38 WARNING (SyncWorker_49) [zeroconf] Error sending through socket 10
Traceback (most recent call last):
  File "/var/homeassistant/lib/python3.7/site-packages/zeroconf/__init__.py", line 2914, in send
    bytes_sent = s.sendto(packet, 0, (real_addr, port))

homeassistant# dpkg -l | grep pyth
ii  dh-python                              3.20180325ubuntu2                                         all          Debian helper tools for packaging Python libraries and applications
ii  libpython-all-dev:amd64                2.7.15~rc1-1                                              amd64        package depending on all supported Python development packages
ii  libpython-dev:amd64                    2.7.15~rc1-1                                              amd64        header files and a static library for Python (default)
ii  libpython-stdlib:amd64                 2.7.15~rc1-1                                              amd64        interactive high-level object-oriented language (default python version)
ii  libpython2.7:amd64                     2.7.17-1~18.04ubuntu1.2                                   amd64        Shared Python runtime library (version 2.7)
ii  libpython2.7-dev:amd64                 2.7.17-1~18.04ubuntu1.2                                   amd64        Header files and a static library for Python (v2.7)
ii  libpython2.7-minimal:amd64             2.7.17-1~18.04ubuntu1.2                                   amd64        Minimal subset of the Python language (version 2.7)
ii  libpython2.7-stdlib:amd64              2.7.17-1~18.04ubuntu1.2                                   amd64        Interactive high-level object-oriented language (standard library, version 2.7)
ii  libpython3-dev:amd64                   3.6.7-1~18.04                                             amd64        header files and a static library for Python (default)
ii  libpython3-stdlib:amd64                3.6.7-1~18.04                                             amd64        interactive high-level object-oriented language (default python3 version)
ii  libpython3.6:amd64                     3.6.9-1~18.04ubuntu1.3                                    amd64        Shared Python runtime library (version 3.6)
ii  libpython3.6-dev:amd64                 3.6.9-1~18.04ubuntu1.3                                    amd64        Header files and a static library for Python (v3.6)
ii  libpython3.6-minimal:amd64             3.6.9-1~18.04ubuntu1.3                                    amd64        Minimal subset of the Python language (version 3.6)
ii  libpython3.6-stdlib:amd64              3.6.9-1~18.04ubuntu1.3                                    amd64        Interactive high-level object-oriented language (standard library, version 3.6)
ii  libpython3.8-minimal:amd64             3.8.6-1+bionic2                                           amd64        Minimal subset of the Python language (version 3.8)
ii  libpython3.8-stdlib:amd64              3.8.6-1+bionic2                                           amd64        Interactive high-level object-oriented language (standard library, version 3.8)
ii  python                                 2.7.15~rc1-1                                              amd64        interactive high-level object-oriented language (default version)
ii  python-all                             2.7.15~rc1-1                                              amd64        package depending on all supported Python runtime versions
ii  python-all-dev                         2.7.15~rc1-1                                              amd64        package depending on all supported Python development packages
ii  python-apt-common                      1.6.5ubuntu0.3                                            all          Python interface to libapt-pkg (locales)
ii  python-asn1crypto                      0.24.0-1                                                  all          Fast ASN.1 parser and serializer (Python 2)
ii  python-avahi                           0.7-3.1ubuntu1.2                                          amd64        Python utility package for Avahi
ii  python-bs4                             4.6.0-1                                                   all          error-tolerant HTML parser for Python
ii  python-cffi-backend                    1.11.5-1                                                  amd64        Foreign Function Interface for Python calling C code - backend
ii  python-chardet                         3.0.4-1                                                   all          universal character encoding detector for Python2
ii  python-crypto                          2.6.1-8ubuntu2                                            amd64        cryptographic algorithms and protocols for Python
ii  python-cryptography                    2.1.4-1ubuntu1.3                                          amd64        Python library exposing cryptographic recipes and primitives (Python 2)
ii  python-cups                            1.9.73-2                                                  amd64        Python bindings for CUPS
ii  python-dbus                            1.2.6-1                                                   amd64        simple interprocess messaging system (Python interface)
ii  python-dev                             2.7.15~rc1-1                                              amd64        header files and a static library for Python (default)
ii  python-dnspython                       1.15.0-1                                                  all          DNS toolkit for Python
ii  python-enum34                          1.1.6-2                                                   all          backport of Python 3.4's enum package
ii  python-gdbm                            2.7.17-1~18.04                                            amd64        GNU dbm database support for Python2
ii  python-gi                              3.26.1-2ubuntu1                                           amd64        Python 2.x bindings for gobject-introspection libraries
ii  python-html5lib                        0.999999999-1                                             all          HTML parser/tokenizer based on the WHATWG HTML5 specification
ii  python-idna                            2.6-1                                                     all          Python IDNA2008 (RFC 5891) handling (Python 2)
ii  python-ipaddress                       1.0.17-1                                                  all          Backport of Python 3 ipaddress module (Python 2)
ii  python-keyring                         10.6.0-1                                                  all          store and access your passwords safely
ii  python-keyrings.alt                    3.0-1                                                     all          alternate backend implementations for python-keyring
ii  python-ldb:amd64                       2:1.2.3-1ubuntu0.1                                        amd64        Python bindings for LDB
ii  python-lxml:amd64                      4.2.1-1ubuntu0.1                                          amd64        pythonic binding for the libxml2 and libxslt libraries
ii  python-minimal                         2.7.15~rc1-1                                              amd64        minimal subset of the Python language (default version)
ii  python-mysqldb                         1.3.10-1build1                                            amd64        Python interface to MySQL
ii  python-pip                             9.0.1-2.3~ubuntu1.18.04.4                                 all          Python package installer
ii  python-pip-whl                         9.0.1-2.3~ubuntu1.18.04.4                                 all          Python package installer
ii  python-pkg-resources                   39.0.1-2                                                  all          Package Discovery and Resource Access using pkg_resources
ii  python-pyrad                           2.0-3                                                     all          Python module for creating and decoding RADIUS packets (Python 2)
ii  python-samba                           2:4.7.6+dfsg~ubuntu-0ubuntu2.20                           amd64        Python bindings for Samba
ii  python-secretstorage                   2.3.1-2                                                   all          Python module for storing secrets - Python 2.x version
ii  python-serial                          3.4-2                                                     all          pyserial - module encapsulating access for the serial port
ii  python-setuptools                      39.0.1-2                                                  all          Python Distutils Enhancements
ii  python-six                             1.11.0-2                                                  all          Python 2 and 3 compatibility library (Python 2 interface)
ii  python-talloc                          2.1.10-2ubuntu1                                           amd64        hierarchical pool based memory allocator - Python bindings
ii  python-tdb                             1.3.15-2                                                  amd64        Python bindings for TDB
ii  python-virtualenv                      15.1.0+ds-1.1                                             all          Python virtual environment creator
ii  python-webencodings                    0.5-2                                                     all          Python implementation of the WHATWG Encoding standard
ii  python-wheel                           0.30.0-0.2                                                all          built-package format for Python
ii  python-xdg                             0.25-4ubuntu1                                             all          Python 2 library to access freedesktop.org standards
ii  python2.7                              2.7.17-1~18.04ubuntu1.2                                   amd64        Interactive high-level object-oriented language (version 2.7)
ii  python2.7-dev                          2.7.17-1~18.04ubuntu1.2                                   amd64        Header files and a static library for Python (v2.7)
ii  python2.7-minimal                      2.7.17-1~18.04ubuntu1.2                                   amd64        Minimal subset of the Python language (version 2.7)
ii  python3                                3.6.7-1~18.04                                             amd64        interactive high-level object-oriented language (default python3 version)
ii  python3-apt                            1.6.5ubuntu0.3                                            amd64        Python 3 interface to libapt-pkg
ii  python3-asn1crypto                     0.24.0-1                                                  all          Fast ASN.1 parser and serializer (Python 3)
ii  python3-certifi                        2018.1.18-2                                               all          root certificates for validating SSL certs and verifying TLS hosts (python3)
ii  python3-cffi-backend                   1.11.5-1                                                  amd64        Foreign Function Interface for Python 3 calling C code - runtime
ii  python3-chardet                        3.0.4-1                                                   all          universal character encoding detector for Python3
ii  python3-crypto                         2.6.1-8ubuntu2                                            amd64        cryptographic algorithms and protocols for Python 3
ii  python3-cryptography                   2.1.4-1ubuntu1.3                                          amd64        Python library exposing cryptographic recipes and primitives (Python 3)
ii  python3-cups                           1.9.73-2                                                  amd64        Python3 bindings for CUPS
ii  python3-dbus                           1.2.6-1                                                   amd64        simple interprocess messaging system (Python 3 interface)
ii  python3-dev                            3.6.7-1~18.04                                             amd64        header files and a static library for Python (default)
ii  python3-distutils                      3.6.9-1~18.04                                             all          distutils package for Python 3.x
ii  python3-gi                             3.26.1-2ubuntu1                                           amd64        Python 3 bindings for gobject-introspection libraries
ii  python3-idna                           2.6-1                                                     all          Python IDNA2008 (RFC 5891) handling (Python 3)
rc  python3-json-pointer                   1.10-1                                                    all          resolve JSON pointers - Python 3.x
rc  python3-jsonpatch                      1.19+really1.16-1fakesync1                                all          library to apply JSON patches - Python 3.x
rc  python3-jsonschema                     2.6.0-2                                                   all          An(other) implementation of JSON Schema (Draft 3 and 4) - Python 3.x
ii  python3-keyring                        10.6.0-1                                                  all          store and access your passwords safely - Python 3 version of the package
ii  python3-keyrings.alt                   3.0-1                                                     all          alternate backend implementations for python3-keyring
ii  python3-lib2to3                        3.6.9-1~18.04                                             all          Interactive high-level object-oriented language (2to3, version 3.6)
ii  python3-minimal                        3.6.7-1~18.04                                             amd64        minimal subset of the Python language (default python3 version)
ii  python3-newt:amd64                     0.52.20-1ubuntu1                                          amd64        NEWT module for Python3
ii  python3-olefile                        0.45.1-1                                                  all          Python module to read/write MS OLE2 files
ii  python3-openssl                        17.5.0-1ubuntu1                                           all          Python 3 wrapper around the OpenSSL library
rc  python3-pbr                            3.1.1-3ubuntu3                                            all          inject useful and sensible default behaviors into setuptools - Python 3.x
ii  python3-pexpect                        4.2.1-1                                                   all          Python 3 module for automating interactive applications
ii  python3-pil:amd64                      5.1.0-1ubuntu0.3                                          amd64        Python Imaging Library (Python3)
ii  python3-pip                            9.0.1-2.3~ubuntu1.18.04.4                                 all          Python package installer
ii  python3-pkg-resources                  39.0.1-2                                                  all          Package Discovery and Resource Access using pkg_resources
ii  python3-ptyprocess                     0.5.2-1                                                   all          Run a subprocess in a pseudo terminal from Python 3
ii  python3-pyinotify                      0.9.6-1                                                   all          simple Linux inotify Python bindings
ii  python3-renderpm:amd64                 3.4.0-3ubuntu0.1                                          amd64        python low level render interface
ii  python3-reportlab                      3.4.0-3ubuntu0.1                                          all          ReportLab library to create PDF documents using Python3
ii  python3-reportlab-accel:amd64          3.4.0-3ubuntu0.1                                          amd64        C coded extension accelerator for the ReportLab Toolkit
ii  python3-requests                       2.18.4-2ubuntu0.1                                         all          elegant and simple HTTP library for Python3, built for human beings
ii  python3-secretstorage                  2.3.1-2                                                   all          Python module for storing secrets - Python 3.x version
ii  python3-setuptools                     39.0.1-2                                                  all          Python3 Distutils Enhancements
ii  python3-six                            1.11.0-2                                                  all          Python 2 and 3 compatibility library (Python 3 interface)
ii  python3-systemd                        234-1build1                                               amd64        Python 3 bindings for systemd
rc  python3-twisted                        17.9.0-2ubuntu0.1                                         all          Event-based framework for internet applications
ii  python3-urllib3                        1.22-1ubuntu0.18.04.2                                     all          HTTP library with thread-safe connection pooling for Python3
ii  python3-venv                           3.6.7-1~18.04                                             amd64        pyvenv-3 binary for python3 (default python3 version)
ii  python3-virtualenv                     15.1.0+ds-1.1                                             all          Python virtual environment creator
ii  python3-wheel                          0.30.0-0.2                                                all          built-package format for Python
ii  python3-xdg                            0.25-4ubuntu1                                             all          Python 3 library to access freedesktop.org standards
ii  python3-yaml                           3.12-1build2                                              amd64        YAML parser and emitter for Python3
ii  python3.6                              3.6.9-1~18.04ubuntu1.3                                    amd64        Interactive high-level object-oriented language (version 3.6)
ii  python3.6-dev                          3.6.9-1~18.04ubuntu1.3                                    amd64        Header files and a static library for Python (v3.6)
ii  python3.6-minimal                      3.6.9-1~18.04ubuntu1.3                                    amd64        Minimal subset of the Python language (version 3.6)
ii  python3.6-venv                         3.6.9-1~18.04ubuntu1.3                                    amd64        Interactive high-level object-oriented language (pyvenv binary, version 3.6)
ii  python3.8                              3.8.6-1+bionic2                                           amd64        Interactive high-level object-oriented language (version 3.8)
ii  python3.8-minimal                      3.8.6-1+bionic2                                           amd64        Minimal subset of the Python language (version 3.8)

but i have pytho 3.8 installed.

Any hint?

Thx in advance.

Did you create a new venv with the new python version? Here’s a guide.

Yes, i have venv creted. how do i migrate everything from from venv 3.7 to venv 3.8?

I don’t know anymore, haven’t used HA in a venv for more than 2 years.

I have a feeling that a venv install is not the right install method for you. Why not run it in docker or supervised and forget about all the struggles with new python versions?

I just upgraded to 3.8.6 using the guide linked below, what does “python3 --version” show?

The following guide I used to upgrade from 3.5 to 3.6

ok, this did the trick for 3.8.

thanks for the fine support.