Giter Site home page Giter Site logo

Comments (8)

dicej avatar dicej commented on July 2, 2024 1

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.

dicej avatar dicej commented on July 2, 2024

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.

erlingto avatar erlingto commented on July 2, 2024

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):

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.

dicej avatar dicej commented on July 2, 2024

Okay, I managed to reproduce this on Windows; I'll dig into it.

from componentize-py.

dicej avatar dicej commented on July 2, 2024

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.

dicej avatar dicej commented on July 2, 2024

This should be fixed in #93. I'll be releasing v0.13.4 once that's merged and CI finishes.

from componentize-py.

dicej avatar dicej commented on July 2, 2024

I've released v0.13.4 with the fix; please let me know if you still have any issues.

from componentize-py.

erlingto avatar erlingto commented on July 2, 2024

Great, Thanks! I will test it tommorow :)

from componentize-py.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.