gdb: warning: Couldn't determine a path for the index cache directory

Question

sh-5.1# gdb
gdb: warning: Couldn't determine a path for the index cache directory.
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Python path configuration:
  PYTHONHOME = (not set)
  PYTHONPATH = (not set)
  program name = '/usr/bin/python'
  isolated = 0
  environment = 1
  user site = 1
  import site = 1
  sys._base_executable = '/usr/bin/python'
  sys.base_prefix = '/usr'
  sys.base_exec_prefix = '/usr'
  sys.platlibdir = 'lib'
  sys.executable = '/usr/bin/python'
  sys.prefix = '/usr'
  sys.exec_prefix = '/usr'
  sys.path = [
    '/usr/lib/python310.zip',
    '/usr/lib/python3.10',
    '/usr/lib/lib-dynload',
  ]
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 0x0000007f89bec440 (most recent call first):
  <no Python frame>

Answer

export HOME=/root
mkdir -p /userdata/usr/lib/
adb push /opt/os-sdk/16.0.0-aarch64/16.0.0-aarch64/sysroots/aarch64-uhos-linux/usr/lib/python3.10/ /userdata/usr/lib/

export PYTHONHOME=/usr
export PYTHONPATH=/userdata/usr/lib/python3.10:/userdata/usr/lib/python3.10/lib-dynload:/userdata/usr/lib/python3.10/lib-dynload
0%