You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
More specifically I'm looking for the to_py(...) function, so I can convert the data = await request.json() object from Javascript to Python. Supposedly, per ChatGPT, this function was introduced in pyodide version 0.21.0. But regardless it's in the latest version on their site.
Error: PythonError: Traceback (most recent call last):
File "/lib/python312.zip/_pyodide/_base.py", line 629, in pyimport_impl
res = import(stem, fromlist=fromlist)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/session/metadata/entry.py", line 9, in
from pyodide.ffi import to_py
ImportError: cannot import name 'to_py' from 'pyodide.ffi' (/lib/python312.zip/pyodide/ffi/init.py)
at async Object.fetch (file:///Users/.../node_modules/miniflare/dist/src/workers/core/entry.worker.js:1029:22)
The text was updated successfully, but these errors were encountered:
I've definitely used to_py with the version of Pyodide that is currently shipped in Python Workers. Can you share a more complete example of your worker code?
Which Cloudflare product(s) does this pertain to?
Workers Runtime
What versions are you using?
wrangler 3.99.0
What operating system and version are you using?
Mac Sonoma 14.6.1
Please provide a link to a minimal reproduction
No response
Describe the Bug
This is all from an environment I built fresh on Jan 1 2025 - e.g.
brew install node
etc.It appears pyodide is an alpha version:
pyodide Version: 0.26.0a2
print( f"{dir(pyodide)}")
results in:More specifically I'm looking for the
to_py(...)
function, so I can convert thedata = await request.json()
object from Javascript to Python. Supposedly, per ChatGPT, this function was introduced in pyodide version 0.21.0. But regardless it's in the latest version on their site.https://pyodide.org/en/stable/usage/api/python-api/ffi.html#pyodide.ffi.JsArray.to_py
Please provide any relevant error logs
Error: PythonError: Traceback (most recent call last):
File "/lib/python312.zip/_pyodide/_base.py", line 629, in pyimport_impl
res = import(stem, fromlist=fromlist)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/session/metadata/entry.py", line 9, in
from pyodide.ffi import to_py
ImportError: cannot import name 'to_py' from 'pyodide.ffi' (/lib/python312.zip/pyodide/ffi/init.py)
The text was updated successfully, but these errors were encountered: