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/base_command.py", line 165, in exc_logging_wrapper
    status = run_func(*args)
  File "/usr/lib/python3/dist-packages/pip/_internal/cli/req_command.py", line 205, in wrapper
    return func(self, options, args)
  File "/usr/lib/python3/dist-packages/pip/_internal/commands/install.py", line 255, in run
    options.use_user_site = decide_user_install(
  File "/usr/lib/python3/dist-packages/pip/_internal/commands/install.py", 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/install.py", 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/install.py", line 599, in get_lib_location_guesses
    scheme = get_scheme(
  File "/usr/lib/python3/dist-packages/pip/_internal/locations/__init__.py", line 244, in get_scheme
    old = _distutils.get_scheme(
  File "/usr/lib/python3/dist-packages/pip/_internal/locations/_distutils.py", line 130, in get_scheme
    scheme = distutils_scheme(dist_name, user, home, root, isolated, prefix)
  File "/usr/lib/python3/dist-packages/pip/_internal/locations/_distutils.py", line 69, in distutils_scheme
    i.finalize_options()
  File "/usr/lib/python3.9/distutils/command/install.py", line 306, in finalize_options
    (prefix, exec_prefix) = get_config_vars('prefix', 'exec_prefix')
  File "/usr/lib/python3.9/distutils/sysconfig.py", line 512, in get_config_vars
    func()
  File "/usr/lib/python3.9/distutils/sysconfig.py", line 472, in _init_posix
    _temp = __import__(name, globals(), locals(), ['build_time_vars'], 0)
ModuleNotFoundError: No module named '_sysconfigdata__x86_64-linux-gnu'
homeassistant@wolke:~$ 

Any clue, please?

How is HA installed ? Venv or Docker ?

it’s venv.

Hi,

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/_sysconfigdata__linux_x86_64-linux-gnu.py  /usr/lib/python3.9/_sysconfigdata__x86_64-linux-gnu.py

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