Skip to content

wapm-packages/python

Folders and files

NameName
Last commit message
Last commit date
May 30, 2023
May 25, 2023
May 30, 2023
May 30, 2023
Mar 18, 2018
May 26, 2023
May 24, 2023
Sep 9, 2015
Jul 4, 2014
May 30, 2023
May 25, 2023

Repository files navigation

Python

You can install Python with:

wapm install python

Running

From WAPM

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.

From Locally-built Binary

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.

Building from Source

Dependencies

  • GNU Make
  • WASI SDK
  • native C toolchain (eg. gcc or clang)

Instructions

To download the WASI SDK and build cpython and its dependencies:

git submodule init
git submodule update --recursive
make wasi-sdk
make