Open abzou7275 opened 1 week ago
CC @dicej might have more context about an issue like this.
Hi @abzou7275! I'm having trouble finding a hello-python
example in either this repo or the spin-python-sdk repo. I also can't find a template with that name. Where did you get it from?
BTW, this is a good place to start if you're new to using Python with Spin: https://developer.fermyon.com/spin/v2/python-components
And since it looks like you're using Windows, please make sure you use componentize-py
0.13.4, which includes a recent fix for building components on Windows.
Ah, perhaps you're following the Python directions on https://developer.fermyon.com/spin/v2/quickstart ? If so, did you make sure to follow all the steps, including the pip3 install -r requirements.txt
one? If so, and you're still having issues, please post a complete list of the steps you took from the beginning, and I'll try to reproduce the issue.
I followed exact steps in the quick start https://developer.fermyon.com/spin/v2/quickstart. Except I used conda to create the virtual env. I tested in two windows machines, all have the same issue.
Would you mind trying it using python3 -m venv venv
to create the virtual env? componentize-py
doesn't know how to discover the site-packages
directory in a conda-based venv, so I imagine that's the problem.
Now, I am getting different error.
(venv) D:\project-spin\hello-python>spin build
Building component hello-python with componentize-py -w spin-http componentize app -o app.wasm
Traceback (most recent call last):
File "
Caused by: ModuleNotFoundError: No module named 'spin_sdk\wit' Error: Build command for component hello-python failed with status Exited(1)
Can you double-check you're using componentize-py
0.13.4 by running componentize-py --version
?
I'll try to repro this once I have access to a Windows machine later today.
yes, I am using componentize-py 0.13.4
I was able to reproduce this; will debug and report back when I have a fix. Thanks for reporting it!
This fixes it: https://github.com/bytecodealliance/componentize-py/pull/95
I'll upload a new release once that's merged and CI finishes.
A 0.13.5 release is available with the fix. Please let me know if that works for you.
spin --version
) spin 2.6.0 (a4ddd39 2024-06-20)spin plugins list --installed
) No plugins foundWhen I tried to build hello-python on my windows machine:
Building component hello-python with", line 198, in _run_module_as_main
File "", line 88, in _run_code
File "D:\miniconda3\envs\spin\Scripts\componentize-py.exe__main__.py", line 7, in
AssertionError: no WIT files found; please specify the directory or file containing the WIT world you wish to target
componentize-py -w spin-http componentize app -o app.wasm
Traceback (most recent call last): File "Caused by: 0: failed to read file "wit" 1: The system cannot find the file specified. (os error 2) Error: Build command for component hello-python failed with status Exited(1)