Python-3.10.7 fails to build

I'm trying to build an image for an Olimex A64 board. I've tried building in a Debian 11 VM and my Manjaro laptop using v22.03.2 and master. I haven't built an image for about 5 years, so I am relearning as I go. Does this error have an obvious workaround that I am missing?

make[3]: Leaving directory '/home/markc/openwrt/build_dir/hostpkg/Python-3.10.7'
CFLAGS="-O2 -I/home/markc/openwrt/staging_dir/host/include -I/home/markc/openwrt/staging_dir/hostpkg/include -I/home/markc/openwrt/staging_dir/target-aarch64_cortex-a53_musl/host/include" CPPFLAGS="-I/home/markc/openwrt/staging_dir/host/include -I/home/markc/openwrt/staging_dir/hostpkg/include -I/home/markc/openwrt/staging_dir/target-aarch64_cortex-a53_musl/host/include" CXXFLAGS="" LDFLAGS="-L/home/markc/openwrt/staging_dir/host/lib -L/home/markc/openwrt/staging_dir/hostpkg/lib -L/home/markc/openwrt/staging_dir/target-aarch64_cortex-a53_musl/host/lib -Wl,-rpath,/home/markc/openwrt/staging_dir/hostpkg/lib -Wl,--no-as-needed -lrt" make  -C /home/markc/openwrt/build_dir/hostpkg/Python-3.10.7  sharedmods
make[3]: Entering directory '/home/markc/openwrt/build_dir/hostpkg/Python-3.10.7'
./python -E -S -m sysconfig --generate-posix-vars ;\
if test $? -ne 0 ; then \
        echo "generate-posix-vars failed" ; \
        rm -f ./pybuilddir.txt ; \
        exit 1 ; \
fi
Could not find platform independent libraries <prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Python path configuration:
  PYTHONHOME = (not set)
  PYTHONPATH = (not set)
  program name = './python'
  isolated = 0
  environment = 0
  user site = 1
  import site = 0
  sys._base_executable = '/home/markc/openwrt/build_dir/hostpkg/Python-3.10.7/python'
  sys.base_prefix = '/home/markc/openwrt/staging_dir/hostpkg'
  sys.base_exec_prefix = '/home/markc/openwrt/staging_dir/hostpkg'
  sys.platlibdir = 'lib'
  sys.executable = '/home/markc/openwrt/build_dir/hostpkg/Python-3.10.7/python'
  sys.prefix = '/home/markc/openwrt/staging_dir/hostpkg'
  sys.exec_prefix = '/home/markc/openwrt/staging_dir/hostpkg'
  sys.path = [
    '/home/markc/openwrt/staging_dir/hostpkg/lib/python310.zip',
    '/home/markc/openwrt/staging_dir/hostpkg/lib/python3.10',
    '/home/markc/openwrt/build_dir/hostpkg/Python-3.10.7/none\n',
  ]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'

Current thread 0x00007ff173b83740 (most recent call first):
  <no Python frame>
generate-posix-vars failed
make[3]: *** [Makefile:615: pybuilddir.txt] Error 1
make[3]: Leaving directory '/home/markc/openwrt/build_dir/hostpkg/Python-3.10.7'
make[2]: *** [Makefile:379: /home/markc/openwrt/build_dir/hostpkg/Python-3.10.7/.built] Error 2
make[2]: Leaving directory '/home/markc/openwrt/feeds/packages/lang/python/python3'
time: package/feeds/packages/python3/host-compile#83.80#9.95#95.10
    ERROR: package/feeds/packages/python3 [host] failed to build.
make[1]: *** [package/Makefile:114: package/feeds/packages/python3/host/compile] Error 1
make[1]: Leaving directory '/home/markc/openwrt'
make: *** [/home/markc/openwrt/include/toplevel.mk:231: package/feeds/packages/python3/host/compile] Error 2