ModuleNotFoundError when trying to build examples

Ouverte
#259 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Évaluation

Difficulté
3/5
Temps estimé
Une demi-journée
Accessibilité débutants
40/100
Type d'issue
Bug
Clarté
Plutôt claire
Activité
Active
Stack technique
python, rust, wasm
Domaine
build-system

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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.

Langage dominant
Rust
Étoiles
284
Forks
56
Merge moyen
2 j 4 h
PR mergées (30 j)
3

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de bytecodealliance/componentize-py

Toutes les issues de bytecodealliance/componentize-py

Issues similaires

Plus d'issues Rust

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.