Codespaces Python startup exception

(I can’t seem to post this in Codespaces Beta category for some reason - if a mod could help, that’d be awesome!)

I’ve started up a recent Codespace, and the Python auto-detection fails, due to some mismatch in the way Python was built and the OS level libraries that are available.

From my creation.log file:

2021-10-17T21:26:31: image detector file exists, platform is python..
2021-10-17T21:26:31: lrwxrwxrwx 1 codespace codespace 18 Oct 17 21:26 /home/codespace/.python/current -> /opt/python/3.8.12
2021-10-17T21:26:31: Python Version: /opt/python/3.8.12/bin/python3.8
2021-10-17T21:26:32: Creating directory for command manifest file if it doesnot exist
2021-10-17T21:26:32: Removing existing manifest file
2021-10-17T21:26:32: Python Virtual Environment: .venv
2021-10-17T21:26:32: Creating virtual environment...
2021-10-17T21:26:32: Activating virtual environment...
2021-10-17T21:26:38: Running python install...
2021-10-17T21:26:38: Traceback (most recent call last):
2021-10-17T21:26:38:   File "", line 3, in <module>
2021-10-17T21:26:38:     from setuptools import setup
2021-10-17T21:26:38:   File "/opt/python/3.8.12/lib/python3.8/site-packages/setuptools/", line 18, in <module>
2021-10-17T21:26:38:     from setuptools.dist import Distribution
2021-10-17T21:26:38:   File "/opt/python/3.8.12/lib/python3.8/site-packages/setuptools/", line 38, in <module>
2021-10-17T21:26:38:     from setuptools import windows_support
2021-10-17T21:26:38:   File "/opt/python/3.8.12/lib/python3.8/site-packages/setuptools/", line 2, in <module>
2021-10-17T21:26:38:     import ctypes
2021-10-17T21:26:38:   File "/opt/python/3.8.12/lib/python3.8/ctypes/", line 7, in <module>
2021-10-17T21:26:38:     from _ctypes import Union, Structure, Array
2021-10-17T21:26:38: ImportError: cannot open shared object file: No such file or directory
2021-10-17T21:26:38: oryx process exited with exit code 1

The OS is VERSION="20.04.3 LTS (Focal Fossa)" - and this is a known issue that Ubuntu 20.04 distribution upgraded libffi6 to libffi7.

$ find /usr/lib -name "*"

My Codespace is then incompletely set up on startup.