Questions tagged [pyodide]

Please prefer using tags for the contained packages with questions which are more specifically related to them. Pyodide brings the Python 3.8 runtime to the browser via WebAssembly, along with the Python scientific stack including NumPy, Pandas, Matplotlib, parts of SciPy, and NetworkX.

Pyodide brings the Python 3.8 runtime to the browser via WebAssembly, along with the Python scientific stack including NumPy, Pandas, Matplotlib, parts of SciPy, and NetworkX.

Home (and source of above quote):
https://github.com/iodide-project/pyodide

110 questions
1
vote
1 answer

My function does not execute when using await in a async function pyscript

I try to fetch data from my api in python using pyscript. Following the pyscript documentation I use the async keyword on my main function and use asyncio.ensure_future to execute it, everything before the first await work but not the await keyword…
1
vote
0 answers

Cannot install openai with micropip

Unable to install openAI in Pyodide I run the following but get the error: Couldn't find a pure Python 3 wheel for 'openai' import micropip await micropip.install('openai')
cadasa
  • 11
  • 2
1
vote
1 answer

Can html with pyscript run python files without freezing everything on the webpage?

I am using pyscript to do image processing for a website I am making on hamming and reed solomon codes. It does however take a long time to load. I have a css loading animation but it freezes while the python image processing code is running. Is…
Liam
  • 13
  • 2
1
vote
1 answer

How to run `python -m `?

How can I run python -m black (or pass Python code as input to main function of black to get formatted output) in Pyodide? Pyodide demo I'm hoping to add a "Format" button to the bottom next to "Run". How to run black is the issue. I can set the…
fejyesynb
  • 172
  • 1
  • 5
1
vote
1 answer

how to get active REPL block in PyScript and copy whatever code written in it?

I have multiple code blocks in pyscript repl which were created dynamically on button click. I want to know which code block is active. I know library adds cm-activeLine class when line is active but that changes when I click some other button to…
Jamshaid Tariq
  • 551
  • 1
  • 8
  • 31
1
vote
1 answer

Why do I get the error: No module named 'pyodide'

I installed pyodide.http but I cannot import it. What did I do wrong? C:\Users\malik>pip install pyodide.http Requirement already satisfied: pyodide.http in c:\users\malik\appdata\local\programs\python\python310\lib\site-packages (0.2.0) WARNING:…
1
vote
2 answers

Unable to import a python package in Pyodide

I am trying to import a custom package in Pyodide but it is not working. The directory structure is index.html package/ __init__.py And my index.html looks like this
Sanskar Jethi
  • 544
  • 5
  • 17
1
vote
0 answers

How to pass an object from React (GatsbyJS) to PyScript

I've created a form in GatsbyJS, and I'd like the data from that form to be passed into an external PyScript file, where it processes the data and returns a value. I've found tutorials that suggest importing the object in the python file, like from…
1
vote
1 answer

How to get Pyodide to work in a React component?

I am trying to make my own Python fundamentals tutorial that's similar to the interactive editor that codecademy.com has. However, I'm struggling to make Pyodide work with React. Using the very basic getting started example, I can make the following…
chillingfox
  • 131
  • 9
1
vote
0 answers

Download a file created in the Pyodide file system

I'm using Pyodide and I have several files in the Pyodide file system. I try to implement the following behavior : the user click on a button to download a specific file from the Pyodide file system the download starts The file to be downloaded is…
Peter Estiven
  • 414
  • 1
  • 7
  • 16
1
vote
1 answer

PyScript ModuleNotFoundError: No module named '_lzma'

Piggybacking off a previous question that I submitted: Using WordNet with PyScript I'm trying to install WordNet in PyScript using await…
1
vote
0 answers

Using WordNet with PyScript

I'm trying to use WordNet within PyScript but I can't seem to properly load Wordnet. At first I tried: - nltk import nltk from nltk.corpus import wordnet as wn This gave me a…
1
vote
2 answers

PyScript: Get image from API and display on webpage

this is my first question on SO. Please give me directions if the question is not clear. I am trying to get an image from a public API and write it on a webpage using PyScript. However, I am not able to get the image to display on the webpage. I…
1
vote
1 answer

How can I import "autosklearn" using pyodide?

I want to perform ML in the browser with "autosklearn" via Pyodide. I think Im supposed to load micropip and then use that to load autosklearn from PyPI. But Im getting a CORS error and not sure how Im supposed to go about this. Pyodide and PyPI…
Leon
  • 5,701
  • 3
  • 38
  • 38
1
vote
1 answer

How to add turtle module to Pyodide?

I tried using turtle functions in web(pyodide) it was not working then i saw that they have removed some inbuilt module from pyodide turtle is one of it.I want turtle to work on web how can i ?