Comments (8)
Ohh, does this mean I will only be able to use "modified" packages with this?
Pure Python packages should work straight from e.g. pypi.org. Packages which contain native extensions (such as NumPy) must be built for WASI (i.e. the Mac, Windows, and Linux builds won't work). Some day, package maintainers will be able to publish WASI builds to pypi.org alongside the existing Mac, Windows, and Linux builds, but we're not there yet. Hence the wasi-wheels
repo linked to in the instructions.
These are the steps im doing (From the "\examples\matrix-math" directory):
* cargo install --version 18.0.0 wasmtime-cli * pip install componentize-py==0.13.3 * curl -o numpy-wasi.tar.gz https://github.com/dicej/wasi-wheels/releases/download/v0.0.1/numpy-wasi.tar.gz (my terminal wont accept -OL for some reason, but these two steps should just be downloading and unpacking the file right?) * tar xf numpy-wasi.tar.gz
Then when im running: "componentize-py -d ../../wit -w matrix-math componentize app -o matrix-math.wasm"
That all looks reasonable to me. I don't have a Windows machine handy at the moment, but I'll give it a try when I have a chance.
from componentize-py.
Assuming you've followed the directions in https://github.com/bytecodealliance/componentize-py/blob/main/examples/matrix-math/README.md, it actually makes sense you'd get that error when running python app.py
directly, because numpy-wasi.tar.gz
only has .so files built for WASI, and your native python
won't be able to load them.
I just tried following the directions in that README.md and it worked for me. What platform are you using? Does it help to use a virtual environment (e.g. python3 -m venv .venv && source .venv/bin/activate
before running the other instructions)?
from componentize-py.
Ohh, does this mean I will only be able to use "modified" packages with this?
I just reinstalled Python and attempted the example again.
These are the steps im doing (From the "\examples\matrix-math" directory):
- cargo install --version 18.0.0 wasmtime-cli
- pip install componentize-py==0.13.3
- curl -o numpy-wasi.tar.gz https://github.com/dicej/wasi-wheels/releases/download/v0.0.1/numpy-wasi.tar.gz (my terminal wont accept -OL for some reason, but these two steps should just be downloading and unpacking the file right?)
- tar xf numpy-wasi.tar.gz
Then when im running:
"componentize-py -d ../../wit -w matrix-math componentize app -o matrix-math.wasm"
I get the same error as before, im on a windows computer at the moment running the commands from Command Prompt . Might try to test the example on a different computer tomorrow.
from componentize-py.
Okay, I managed to reproduce this on Windows; I'll dig into it.
from componentize-py.
Ugh, looks like a back-slash-vs-forward-slash issue in the paths wit-component
is generating to populate the dlopen
table. I guess this has probably never worked right on Windows 🤦
Thanks for reporting this. I'll start working on a fix.
from componentize-py.
This should be fixed in #93. I'll be releasing v0.13.4 once that's merged and CI finishes.
from componentize-py.
I've released v0.13.4 with the fix; please let me know if you still have any issues.
from componentize-py.
Great, Thanks! I will test it tommorow :)
from componentize-py.
Related Issues (20)
- pyo3_runtime.PanicException: internal error: entered unreachable code HOT 3
- Running component without WASI HOT 2
- Run MyPy on all test code and bindings HOT 1
- Running example HOT 3
- Question: Current types limitation HOT 6
- Matrix-math example - ImportError... HOT 4
- List errors which might be raised in function docstrings
- Make the types generated for WIT resources context managers
- feature: add zlib to cpython build HOT 1
- Generated component has dependency on wasi:cli/[email protected] HOT 14
- Create more actionable error for disallowed name for a Python module
- Broken http example: import error from poll_loop.py: StreamErrorClosed HOT 1
- Matrix-math example - no world named `matrix-math` in package HOT 4
- Unresolved symbols when building from source HOT 2
- Type checking fails when records are defined in a world with functions HOT 1
- Issue encountered when trying to execute app.wasm using wasmtime HOT 3
- Allow dynamic imports in sandbox example HOT 6
- Http example doesn't work with Wasmtime 21.0.1 HOT 3
- [bug] zlib support required by widely used python modules HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from componentize-py.