Help with upgrading Core Install to Python3.10 on RPI4

Hello,
Since Python 3.9 won’t be supported next month, I wanted to upgrade my core install to Python3.10.
However, Python3.10 isn’t included
The first time I tried, I had forgotten to install the libsqlite-dev package so my Python so it couldn’t connect to the database but now I’ve followed the instructions at https://computingforgeeks.com/how-to-install-python-on-debian-linux/ and still, integrations won’t load (I’ve waited 20 minutes for that).
See below the logs (before and after I killed the process)

2023-01-16 10:58:12.048 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-01-16 11:09:38.766 ERROR (MainThread) [frontend.js.latest.202301100] :0:0 ResizeObserver loop completed with undelivered notifications.
2023-01-16 11:21:50.222 ERROR (MainThread) [homeassistant.setup] Setup failed for custom integration midea_ac_lan: Unable to import component: No module named 'Crypto'
2023-01-16 11:21:50.815 ERROR (MainThread) [homeassistant.setup] Error during setup of component application_credentials
Traceback (most recent call last):
  File "/srv/hass-2023/lib/python3.10/site-packages/homeassistant/runner.py", line 120, in run
    return loop.run_until_complete(setup_and_run_hass(runtime_config))
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 636, in run_until_complete
    self.run_forever()
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 603, in run_forever
    self._run_once()
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 1868, in _run_once
    event_list = self._selector.select(timeout)
  File "/usr/local/lib/python3.10/selectors.py", line 469, in select
    fd_event_list = self._selector.poll(timeout, max_ev)
KeyboardInterrupt

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/hass-2023/lib/python3.10/site-packages/homeassistant/setup.py", line 253, in _async_setup_component
    result = await task
  File "/srv/hass-2023/lib/python3.10/site-packages/homeassistant/components/application_credentials/__init__.py", line 150, in async_setup
    await storage_collection.async_load()
  File "/srv/hass-2023/lib/python3.10/site-packages/homeassistant/helpers/collection.py", line 245, in async_load
    raw_storage = await self._async_load_data()
  File "/srv/hass-2023/lib/python3.10/site-packages/homeassistant/helpers/collection.py", line 241, in _async_load_data
    return cast(Optional[dict], await self.store.async_load())
  File "/srv/hass-2023/lib/python3.10/site-packages/homeassistant/helpers/storage.py", line 116, in async_load
    return await self._load_task
  File "/srv/hass-2023/lib/python3.10/site-packages/homeassistant/helpers/storage.py", line 125, in _async_load
    return await self._async_load_data()
  File "/srv/hass-2023/lib/python3.10/site-packages/homeassistant/helpers/storage.py", line 143, in _async_load_data
    data = await self.hass.async_add_executor_job(
  File "/srv/hass-2023/lib/python3.10/site-packages/homeassistant/core.py", line 527, in async_add_executor_job
    task = self.loop.run_in_executor(None, target, *args)
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 814, in run_in_executor
    self._check_default_executor()
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 519, in _check_default_executor
    raise RuntimeError('Executor shutdown has been called')
RuntimeError: Executor shutdown has been called
2023-01-16 11:21:50.823 ERROR (MainThread) [homeassistant.setup] Error during setup of component input_text
Traceback (most recent call last):
  File "/srv/hass-2023/lib/python3.10/site-packages/homeassistant/runner.py", line 120, in run
    return loop.run_until_complete(setup_and_run_hass(runtime_config))
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 636, in run_until_complete
    self.run_forever()
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 603, in run_forever
    self._run_once()
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 1868, in _run_once
    event_list = self._selector.select(timeout)
  File "/usr/local/lib/python3.10/selectors.py", line 469, in select
    fd_event_list = self._selector.poll(timeout, max_ev)
KeyboardInterrupt

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/hass-2023/lib/python3.10/site-packages/homeassistant/setup.py", line 253, in _async_setup_component
    result = await task
  File "/srv/hass-2023/lib/python3.10/site-packages/homeassistant/components/input_text/__init__.py", line 137, in async_setup
    await storage_collection.async_load()
  File "/srv/hass-2023/lib/python3.10/site-packages/homeassistant/helpers/collection.py", line 245, in async_load
    raw_storage = await self._async_load_data()
  File "/srv/hass-2023/lib/python3.10/site-packages/homeassistant/helpers/collection.py", line 241, in _async_load_data
    return cast(Optional[dict], await self.store.async_load())
  File "/srv/hass-2023/lib/python3.10/site-packages/homeassistant/helpers/storage.py", line 116, in async_load
    return await self._load_task
  File "/srv/hass-2023/lib/python3.10/site-packages/homeassistant/helpers/storage.py", line 125, in _async_load
    return await self._async_load_data()
  File "/srv/hass-2023/lib/python3.10/site-packages/homeassistant/helpers/storage.py", line 143, in _async_load_data
    data = await self.hass.async_add_executor_job(
  File "/srv/hass-2023/lib/python3.10/site-packages/homeassistant/core.py", line 527, in async_add_executor_job
    task = self.loop.run_in_executor(None, target, *args)
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 814, in run_in_executor
    self._check_default_executor()
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 519, in _check_default_executor
    raise RuntimeError('Executor shutdown has been called')
RuntimeError: Executor shutdown has been called
2023-01-16 11:21:50.829 ERROR (MainThread) [homeassistant.setup] Error during setup of component input_datetime
Traceback (most recent call last):
  File "/srv/hass-2023/lib/python3.10/site-packages/homeassistant/runner.py", line 120, in run
    return loop.run_until_complete(setup_and_run_hass(runtime_config))
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 636, in run_until_complete
    self.run_forever()
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 603, in run_forever
    self._run_once()
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 1868, in _run_once
    event_list = self._selector.select(timeout)
  File "/usr/local/lib/python3.10/selectors.py", line 469, in select
    fd_event_list = self._selector.poll(timeout, max_ev)
KeyboardInterrupt

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/hass-2023/lib/python3.10/site-packages/homeassistant/setup.py", line 253, in _async_setup_component
    result = await task
  File "/srv/hass-2023/lib/python3.10/site-packages/homeassistant/components/input_datetime/__init__.py", line 160, in async_setup
    await storage_collection.async_load()
  File "/srv/hass-2023/lib/python3.10/site-packages/homeassistant/helpers/collection.py", line 245, in async_load
    raw_storage = await self._async_load_data()
  File "/srv/hass-2023/lib/python3.10/site-packages/homeassistant/helpers/collection.py", line 241, in _async_load_data
    return cast(Optional[dict], await self.store.async_load())
  File "/srv/hass-2023/lib/python3.10/site-packages/homeassistant/helpers/storage.py", line 116, in async_load
    return await self._load_task
  File "/srv/hass-2023/lib/python3.10/site-packages/homeassistant/helpers/storage.py", line 125, in _async_load
    return await self._async_load_data()
  File "/srv/hass-2023/lib/python3.10/site-packages/homeassistant/helpers/storage.py", line 143, in _async_load_data
    data = await self.hass.async_add_executor_job(
  File "/srv/hass-2023/lib/python3.10/site-packages/homeassistant/core.py", line 527, in async_add_executor_job
    task = self.loop.run_in_executor(None, target, *args)
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 814, in run_in_executor
    self._check_default_executor()
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 519, in _check_default_executor
    raise RuntimeError('Executor shutdown has been called')
RuntimeError: Executor shutdown has been called
2023-01-16 11:21:50.899 ERROR (MainThread) [homeassistant.setup] Error during setup of component input_boolean
Traceback (most recent call last):
  File "/srv/hass-2023/lib/python3.10/site-packages/homeassistant/runner.py", line 120, in run
    return loop.run_until_complete(setup_and_run_hass(runtime_config))
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 636, in run_until_complete
    self.run_forever()
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 603, in run_forever
    self._run_once()
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 1868, in _run_once
    event_list = self._selector.select(timeout)
  File "/usr/local/lib/python3.10/selectors.py", line 469, in select
    fd_event_list = self._selector.poll(timeout, max_ev)
KeyboardInterrupt

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/hass-2023/lib/python3.10/site-packages/homeassistant/setup.py", line 253, in _async_setup_component
    result = await task
  File "/srv/hass-2023/lib/python3.10/site-packages/homeassistant/components/input_boolean/__init__.py", line 122, in async_setup
    await storage_collection.async_load()
  File "/srv/hass-2023/lib/python3.10/site-packages/homeassistant/helpers/collection.py", line 245, in async_load
    raw_storage = await self._async_load_data()
  File "/srv/hass-2023/lib/python3.10/site-packages/homeassistant/helpers/collection.py", line 241, in _async_load_data
    return cast(Optional[dict], await self.store.async_load())
  File "/srv/hass-2023/lib/python3.10/site-packages/homeassistant/helpers/storage.py", line 116, in async_load
    return await self._load_task
  File "/srv/hass-2023/lib/python3.10/site-packages/homeassistant/helpers/storage.py", line 125, in _async_load
    return await self._async_load_data()
  File "/srv/hass-2023/lib/python3.10/site-packages/homeassistant/helpers/storage.py", line 143, in _async_load_data
    data = await self.hass.async_add_executor_job(
  File "/srv/hass-2023/lib/python3.10/site-packages/homeassistant/core.py", line 527, in async_add_executor_job
    task = self.loop.run_in_executor(None, target, *args)
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 814, in run_in_executor
    self._check_default_executor()
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 519, in _check_default_executor
    raise RuntimeError('Executor shutdown has been called')
RuntimeError: Executor shutdown has been called
2023-01-16 11:21:50.976 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of spotify. Setup failed for dependencies: application_credentials
2023-01-16 11:21:50.977 ERROR (MainThread) [homeassistant.setup] Setup failed for spotify: (DependencyError(...), 'Could not setup dependencies: application_credentials')
2023-01-16 11:21:51.015 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Any door is open for group
Traceback (most recent call last):
  File "/srv/hass-2023/lib/python3.10/site-packages/homeassistant/runner.py", line 120, in run
    return loop.run_until_complete(setup_and_run_hass(runtime_config))
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 636, in run_until_complete
    self.run_forever()
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 603, in run_forever
    self._run_once()
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 1868, in _run_once
    event_list = self._selector.select(timeout)
  File "/usr/local/lib/python3.10/selectors.py", line 469, in select
    fd_event_list = self._selector.poll(timeout, max_ev)
KeyboardInterrupt

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/hass-2023/lib/python3.10/site-packages/homeassistant/config_entries.py", line 382, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/srv/hass-2023/lib/python3.10/site-packages/homeassistant/components/group/__init__.py", line 250, in async_setup_entry
    await hass.config_entries.async_forward_entry_setups(
  File "/srv/hass-2023/lib/python3.10/site-packages/homeassistant/config_entries.py", line 1265, in async_forward_entry_setups
    await asyncio.gather(
  File "/srv/hass-2023/lib/python3.10/site-packages/homeassistant/config_entries.py", line 1280, in async_forward_entry_setup
    result = await async_setup_component(self.hass, domain, self._hass_config)
  File "/srv/hass-2023/lib/python3.10/site-packages/homeassistant/setup.py", line 90, in async_setup_component
    return await setup_tasks[domain]
RuntimeError: Executor shutdown has been called
2023-01-16 11:21:51.023 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Any motion sensor for group
Traceback (most recent call last):
  File "/srv/hass-2023/lib/python3.10/site-packages/homeassistant/runner.py", line 120, in run
    return loop.run_until_complete(setup_and_run_hass(runtime_config))
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 636, in run_until_complete
    self.run_forever()
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 603, in run_forever
    self._run_once()
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 1868, in _run_once
    event_list = self._selector.select(timeout)
  File "/usr/local/lib/python3.10/selectors.py", line 469, in select
    fd_event_list = self._selector.poll(timeout, max_ev)
KeyboardInterrupt

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/hass-2023/lib/python3.10/site-packages/homeassistant/config_entries.py", line 382, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/srv/hass-2023/lib/python3.10/site-packages/homeassistant/components/group/__init__.py", line 250, in async_setup_entry
    await hass.config_entries.async_forward_entry_setups(
  File "/srv/hass-2023/lib/python3.10/site-packages/homeassistant/config_entries.py", line 1265, in async_forward_entry_setups
    await asyncio.gather(
  File "/srv/hass-2023/lib/python3.10/site-packages/homeassistant/config_entries.py", line 1280, in async_forward_entry_setup
    result = await async_setup_component(self.hass, domain, self._hass_config)
  File "/srv/hass-2023/lib/python3.10/site-packages/homeassistant/setup.py", line 90, in async_setup_component
    return await setup_tasks[domain]
RuntimeError: Executor shutdown has been called
2023-01-16 11:21:51.072 ERROR (MainThread) [homeassistant.setup] Error during setup of component script
Traceback (most recent call last):
  File "/srv/hass-2023/lib/python3.10/site-packages/homeassistant/runner.py", line 120, in run
    return loop.run_until_complete(setup_and_run_hass(runtime_config))
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 636, in run_until_complete
    self.run_forever()
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 603, in run_forever
    self._run_once()
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 1868, in _run_once
    event_list = self._selector.select(timeout)
  File "/usr/local/lib/python3.10/selectors.py", line 469, in select
    fd_event_list = self._selector.poll(timeout, max_ev)
KeyboardInterrupt

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/hass-2023/lib/python3.10/site-packages/homeassistant/setup.py", line 253, in _async_setup_component
    result = await task
  File "/srv/hass-2023/lib/python3.10/site-packages/homeassistant/components/script/__init__.py", line 178, in async_setup
    await async_get_blueprints(hass).async_populate()
  File "/srv/hass-2023/lib/python3.10/site-packages/homeassistant/components/blueprint/models.py", line 360, in async_populate
    await self.hass.async_add_executor_job(populate)
  File "/srv/hass-2023/lib/python3.10/site-packages/homeassistant/core.py", line 527, in async_add_executor_job
    task = self.loop.run_in_executor(None, target, *args)
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 814, in run_in_executor
    self._check_default_executor()
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 519, in _check_default_executor
    raise RuntimeError('Executor shutdown has been called')
RuntimeError: Executor shutdown has been called
2023-01-16 11:21:51.092 ERROR (SyncWorker_1) [homeassistant.util.package] Unable to install package PyTurboJPEG==1.6.7: ERROR: Operation cancelled by user

Personally, I’d recommend you use pyenv, that’s the simplest approach. Well, actually, I’d recommend switching to Docker, but if you’re going to stick with venvs then pyenv is the simplest way.

If you want to do it manually then this guide should still work.

1 Like

Thank goodness, this is exactly what I was looking for.
I used the core install so far because I was familiar with venv and never used docker before, but my experience with this upgrade leads me to think otherwise.

UPDATE: I did follow the instructions for Docker and it works great. Had to fiddle a bit with port forwarding but now it’s fine.