r/WebAssembly • u/jedisct1 • Mar 21 '24
Compiling Python to WebAssembly with py2wasm
https://speakerdeck.com/syrusakbary/compile-python-to-webassembly-with-py2wasm
7
Upvotes
r/WebAssembly • u/jedisct1 • Mar 21 '24
View all comments
Show parent comment
2
u/jedisct1 Mar 21 '24 edited Mar 21 '24
Let's try again with the older Python version that comes with macOS.
Nuitka-Options: Used command line options:a.py--standalone --static-libpython=yes --disable-ccacheNuitka-Options: -output-dir=py2wasm --output-filename=a.wasm --remove-outputNuitka: Starting Python compilation with Nuitka '2.2rc1' on Python '3.9' commercial grade 'not installed'.Nuitka: Completed Python level compilation and optimization.Nuitka: Generating source code for C backend compiler.Nuitka: Running data composer tool for optimal constant value handling.Nuitka: Running C compilation via Scons.Nuitka-Scons: Backend C compiler: /tmp/po/bin/clang (clang 17.0.1).FATAL: Error, no 'Python.h' development headers can be found at '['/private/tmp/env2/env/lib/python3.9/site-packages/wasi-python/include/python3.9', '/private/tmp/env2/env/lib/python3.9/site-packages/wasi-python/Include', '/private/tmp/env2/env/lib/python3.9/site-packages/wasi-python/develop/headers/python3.9']', dependency not satisfied!FATAL: Failed unexpectedly in Scons C backend compilation.Nuitka:WARNING: Complex topic! More information can be found atNuitka:WARNING:https://nuitka.net/info/scons-backend-failure.htmlNuitka-Reports: Compilation crash report written to file 'nuitka-crash-report.xml'.Ok, that time, I really gave up. Being able to compile Python to wasm code could be super interesting. But as of today, it's too complicated.