jimkring / python-sandbox-wasm

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

On macOS this worked with Python 3.9 but not 3.11

simonw opened this issue · comments

I tried running this just now on macOS and got the following error:

ImportError: Wasmer is not available on this system

See also:

It looks like there isn't currently a build of wasmer available for macOS Python 3.11. I resolved the problem by using Python 3.9 instead, like this:

python-sandbox-wasm % python3.9 -m venv venv                   
python-sandbox-wasm % source venv/bin/activate
(venv) python-sandbox-wasm % pip install -r requirements/requirements.txt
Collecting wasmer==1.1.0
  Downloading wasmer-1.1.0-cp39-cp39-macosx_10_7_x86_64.whl (1.5 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.5/1.5 MB 2.9 MB/s eta 0:00:00
Collecting wasmer-compiler-cranelift==1.1.0
  Downloading wasmer_compiler_cranelift-1.1.0-cp39-cp39-macosx_10_7_x86_64.whl (1.7 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.7/1.7 MB 4.9 MB/s eta 0:00:00
Installing collected packages: wasmer-compiler-cranelift, wasmer
Successfully installed wasmer-1.1.0 wasmer-compiler-cranelift-1.1.0
(venv) python-sandbox-wasm % python example_sandbox.py 
wasi stdout
WARNING: this string is the result of executing unknown code, so be careful how you use it!
####
Hello, world!
####

Might be worth mentioning this in the README.

From https://pypi.org/project/wasmer/1.1.0/ it looks like Python 3.10 should work to - it's just 3.11 that seems to be missing a build.