TypeError: pyodide.runPythonAsync is not a function at PyButton.eval (base.ts:160:36)
See original GitHub issueThis works fine on one computer, but not another, both running chrome 101.
<py-button id="getscans" label="Load Scans">
def on_click(evt):
print('clicked!')
</button>
Issue Analytics
- State:
- Created a year ago
- Comments:12
Top Results From Across the Web
Pyodide runPythonAsync to html document - Stack Overflow
Basically, you can implement your own function for printing. However, if you want to use exactly print you can override the function from...
Read more >runPythonAsync causes Python exception: AttributeError ...
I have been using pyodide in a project and calling pyodide.runPythonAsync with great success (Great Success!) but recently (the last few ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I found a way that works:
First, instead of using a py-button, I used a regular button, then added an onclick event handler with the DOM.
this caused my function be run with its arguments on script load, instead of onclick.
I had to wrap my python function in another python function, to create a python function that receives an [object PointerEvent], and calls DoStuff with my desired arguments. a simple button doesn’t need to parse the PointerEvent, so I ignore it.
That gave a different set of pyodide errors, which I was able to resolve with help from the pyodide docs.
adding create_proxy gives us a working button:
I’m sure there is a more idiomatic way to do this, but this works.
Your example has the same error with the same line numbers.