Open ygina opened 4 years ago
Hi @ygina - I just stumbled across this issue and thought I might leave a comment for posterity's sake.
The reason this is not working is because your numpy package is compiled for x86_64-linux
. That's because numpy includes C code that needs to be compiled for a particular platform. To get it to work with WASM you would need to compile it to Web Assembly WASI.
Instead I would recommend looking at the Pyodide project. It's a version of python compiled to WASM that includes the scientific stack (things like numpy). https://pyodide.org/en/stable/
I downloaded
python.wasm
from WAPM and am trying to run a Python file with NumPy.I created a custom
lib/
folder with default libraries and the NumPy library fromsite-packages/
:I can use this lib successfully with regular Python since I set
sys.path
:But it fails with
python.wasm
(see full stacktrace):For some reason,
overrides.py
fails to importnumpy.core._multiarray_umath
from the filelib/python3.6/site-packages/numpy/core/_multiarray_umath.cpython-36m-x86_64-linux-gnu.so
?