ModuleNotFoundError when trying to build examples

Aperta
#259 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
Mezza giornata
Idoneità per principianti
40/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python, rust, wasm
Ambito
build-system

Direzione di ricerca

The failure comes from the componentize-py CLI when building examples/cli, where the generated bindings module wit cannot be imported by the app. Start with the README steps and the bindings generation path in the Rust/Python tooling, then reproduce by running the README command from examples/cli. Done means the example builds to cli.wasm without the ModuleNotFoundError, on Windows as well as other platforms.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

I was trying to follow the guidance in README.md to create a simple wasm file, without success. I tried with one of the examples and got the same error so I am thinking there is something wrong apart from me.

  1. Cloned the this repo (main branch, commit f6710d6d53f91f914e106011c72730f78cbc433a)
  2. cd to examples/cli
  3. run componentize-py -d ../../wit -w wasi:cli/[email protected] componentize app -o cli.wasm as stated in the README

I get

Traceback (most recent call last):
  File "<frozen runpy>", line 201, in _run_module_as_main
  File "<frozen runpy>", line 87, in _run_code
  File "C:\.venv\Scripts\componentize-py.exe\__main__.py", line 5, in <module>
    sys.exit(script())
             ~~~~~~^^
AssertionError: Traceback (most recent call last):
  File "/0/app.py", line 1, in <module>
    from wit.exports.wasi.cli_v0_2 import run, Run
ModuleNotFoundError: No module named 'wit'


Caused by:
    ModuleNotFoundError: No module named 'wit'
  • Using windows 11 (x86_64)
  • Python 3.15.2
  • componentize-py 0.25.1

I am aware that the naming of modules etc. has been changed quite recently.

Lingua principale
Rust
Stelle
284
Fork
56
Merge medio
2g 4h
PR unite (30g)
3

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di bytecodealliance/componentize-py

Tutte le issue di bytecodealliance/componentize-py

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.