wasmerio / wasmer-python

🐍🕸 WebAssembly runtime for Python

Home Page:https://wasmer.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

wasmer not available/working on python 3.10, is on 3.9

jmgurney opened this issue · comments

Thanks for the bug report!

Describe the bug

Attempting to run wasmer on Python 3.10 on an arm Mac fails w/:

ImportError: Wasmer is not available on this system                                                                                            

But does work fine w/ Python 3.9.

Steps to reproduce

  1. Using python3.10, make virtualenv: python -m venv p; . ./p/bin/activate
  2. Install wasmer: pip install wasmer
  3. Try to import wasmer: python -c 'import wasmer'
  4. See error

Expected behavior

Per the README.md, it says that 3.10 is supported.

Actual behavior

Error message per above generated:

$ python -c 'import wasmer; from wasmer_compiler_llvm import Compiler'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/jmg/wasm/wasibox/p3.10/lib/python3.10/site-packages/wasmer/__init__.py", line 1, in <module>
    raise ImportError("Wasmer is not available on this system")
ImportError: Wasmer is not available on this system

Additional context

This is an Apple M1 cpu, which though not listed as supported, as is demonstrated above, appears to work fine on 3.9, or at least does not raise an error.

I'm in the process of working through this as well, in the context of fitting it in CICD, after previously making it work via dev compile on my M1.

What I've found works is to directly reference the compiled wheel for the python version in requirements.txt or equivalent, as so:

https://github.com/wasmerio/wasmer-python/releases/download/1.1.0/wasmer-1.1.0-cp310-cp310-manylinux_2_24_x86_64.whl

By just referencing the compiled wheel, you'll get the expected binary.

The source of the problem seems to be a lack of linking (arch mismatch maybe?) somewhere, but in the meantime I noticed I wasn't getting the wheel binary (essentially a default failback) and so explicitly referencing it helped.