Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sometimes running extism-py prints Could not find platform dependent libraries <exec_prefix> #16

Open
zshipko opened this issue Oct 10, 2024 · 5 comments · Fixed by #17

Comments

@zshipko
Copy link
Contributor

zshipko commented Oct 10, 2024

We should look into what's causing that message and how to fix it

@mapix
Copy link

mapix commented Oct 11, 2024

@zshipko
I encountered the same issue on my Mac M1. My Python environment was created with Conda using Python 3.11 (since 3.12 seems to break some syntax). This error prevents operations involving JSON from working. Interestingly, compiling in the root directory of the python-pdk repository works fine, but not in other directories. I was able to bypass the issue by setting PYTHONPATH and PYTHONHOME.

(exism) [Proxy] ➜  python-pdk git:(main) ✗ ./extism-py examples/count-vowels.py -o count-vowels.wasm 
(exism) [Proxy] ➜  python-pdk git:(main) ✗ extism call out.wasm count_vowels --wasi --input='Hello World Test!'
Error: open out.wasm: no such file or directory
(exism) [Proxy] ➜  python-pdk git:(main) ✗ extism call count-vowels.wasm count_vowels --wasi --input='Hello World Test!' 
{"count": 4}
(exism) [Proxy] ➜  python-pdk git:(main) ✗ extism-py examples/count-vowels.py -o count-vowels.wasm                    
(exism) [Proxy] ➜  python-pdk git:(main) ✗ cd ..
(exism) [Proxy] ➜  workspace  ✗ extism-py python-pdk/examples/count-vowels.py -o python-pdk/count-vowels.wasm
Could not find platform dependent libraries <exec_prefix>
(exism) [Proxy] ➜  workspace  ✗ PYTHONPATH=$(python -c "import sys, os.path; print(':'.join([p for p in sys.path if os.path.exists(p)]))") PYTHONHOME=$(python -c "import sys;print(sys.exec_prefix)") extism-py python-pdk/examples/count-vowels.py -o python-pdk/count-vowels.wasm
(exism) [Proxy] ➜  workspace ✗ extism call python-pdk/count-vowels.wasm count_vowels --wasi --input='Hello World Test!' 

{"count": 4}

@zshipko
Copy link
Contributor Author

zshipko commented Oct 23, 2024

Re-opening, it looks like this is not fixed by #17

@zshipko zshipko reopened this Oct 23, 2024
@bhelx
Copy link
Contributor

bhelx commented Dec 3, 2024

I'm still getting this error. I suspect it's why my plugins are crashing anytime i'm trying to use json

@zshipko
Copy link
Contributor Author

zshipko commented Dec 3, 2024

I've tested some basic JSON with that error and it seems to work still.

You can get a better error message from python if you set the environment variable EXTISM_ENABLE_WASI_OUTPUT=1

@bhelx
Copy link
Contributor

bhelx commented Dec 3, 2024

You can get a better error message from python if you set the environment variable EXTISM_ENABLE_WASI_OUTPUT=1

oh boy, was a python type error. thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants