It looks like setting --dir no longer works with 3.14.1. Not knowing what else to do, I filed [WASI-SDK] CPython 3.14.1 can no longer find systemroot in wasi-libc build (3.13.11 works) · Issue #143537 · python/cpython · GitHub with CPython.
$ cd ~/python-3.14.2-wasi_sdk-24/
$ wasmtime --dir . python.wasm
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Fatal Python error: Failed to import encodings module
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'
Current thread 0x012c0ae8 (most recent call first):
<no Python frame>
I tested it with 3.13.11 and it indeed works, as described earlier in the thread.