You can install Python with:
wapm install python
Run a locally python script in the ./lib
directory:
wasmer --net python/python --mapdir=/lib:./lib -- /lib/pythonfile.py
Note: this assumes you have a file named ./lib/pythonfile.py
.
Follow the "Building from Source" instructions below, then:
BUILDDIR="$(PWD)/cpython/builddir-wasix-libc/wasi/"
wasmer --net $BUILDDIR/python.wasm --mapdir=/lib:./lib --mapdir=/usr:$BUILDDIR/usr -- /lib/pythonfile.py
Note: this assumes you have a file named ./lib/pythonfile.py
.
- GNU Make
- WASI SDK
- native C toolchain (eg. gcc or clang)
To download the WASI SDK and build cpython and its dependencies:
git submodule init
git submodule update --recursive
make wasi-sdk
make