wasmer-python icon indicating copy to clipboard operation
wasmer-python copied to clipboard

Embed packages example on website doesn't work.

Open HuakunShen opened this issue 2 years ago • 1 comments

Summary

On wasmer's website https://wasmer.io/products/registry, there is a piece of sample code at the bottom

from wasmer import Wasmer
python = Wasmer("python/python")
runner = python.entrypoint.run('-c "print(1+1)"')
print(python.stdout)

If I understand correctly, this is saying we can run python code in python, rust or other languages. But there are 2 problems,

  1. when I click on other languages, it doesn't show the code in that language, alwasy in python image
  2. The sample code doesn't work at all. I installed wasmer with pip on mac and linux, the sample code don't run. Wasmer is not even exported.

HuakunShen avatar Sep 09 '23 17:09 HuakunShen

Hi, is there any solution?I face the same question with the code:

from wasmer import Wasmer
python = Wasmer("python/python")
runner = python.entrypoint.run('-c "print(1+1)"')
print(python.stdout)

And it turns out this ImportError:

ImportError: cannot import name 'Wasmer' from 'wasmer'

miraclejzd avatar Nov 25 '24 16:11 miraclejzd