Problems by updating HA

Hya, by trying to upgrade HA, i get the following error, under ubuntu 18.04 LTS.

homeassistant@wolke:~$ python3.9 -m pip install --upgrade homeassistant -
ERROR: Exception:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/pip/_internal/cli/", line 165, in exc_logging_wrapper
    status = run_func(*args)
  File "/usr/lib/python3/dist-packages/pip/_internal/cli/", line 205, in wrapper
    return func(self, options, args)
  File "/usr/lib/python3/dist-packages/pip/_internal/commands/", line 255, in run
    options.use_user_site = decide_user_install(
  File "/usr/lib/python3/dist-packages/pip/_internal/commands/", line 667, in decide_user_install
    if site_packages_writable(root=root_path, isolated=isolated_mode):
  File "/usr/lib/python3/dist-packages/pip/_internal/commands/", line 613, in site_packages_writable
    for d in set(get_lib_location_guesses(root=root, isolated=isolated))
  File "/usr/lib/python3/dist-packages/pip/_internal/commands/", line 599, in get_lib_location_guesses
    scheme = get_scheme(
  File "/usr/lib/python3/dist-packages/pip/_internal/locations/", line 244, in get_scheme
    old = _distutils.get_scheme(
  File "/usr/lib/python3/dist-packages/pip/_internal/locations/", line 130, in get_scheme
    scheme = distutils_scheme(dist_name, user, home, root, isolated, prefix)
  File "/usr/lib/python3/dist-packages/pip/_internal/locations/", line 69, in distutils_scheme
  File "/usr/lib/python3.9/distutils/command/", line 306, in finalize_options
    (prefix, exec_prefix) = get_config_vars('prefix', 'exec_prefix')
  File "/usr/lib/python3.9/distutils/", line 512, in get_config_vars
  File "/usr/lib/python3.9/distutils/", line 472, in _init_posix
    _temp = __import__(name, globals(), locals(), ['build_time_vars'], 0)
ModuleNotFoundError: No module named '_sysconfigdata__x86_64-linux-gnu'

Any clue, please?

How is HA installed ? Venv or Docker ?

it’s venv.


I just had the exact same problem on Ubuntu 20.04 LTS also using a venv. Actually I was on 18.04 but upgrade to 20.04 LTS this HA release because of the sql lite version dependency change.

The good news is I seemed to have fixed the problem after doing some searching on the Internet. Here’s the solution.

As a root user execute the following:

sudo ln -s   /usr/lib/python3.9/  /usr/lib/python3.9/

Then switch to your venv and try the upgrade again. I hope this helps