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
17
votes
4 answers

How to redirect/render Pyodide output in browser?

I have recently come across the Pyodide project. I have built a little demo using Pyodide, but although I've spent a lot of time looking at the source, it is not obvious (yet) to me how to redirect print output from python (other than modifying the…
Homunculus Reticulli
  • 65,167
  • 81
  • 216
  • 341
7
votes
2 answers

How to copy / download file created in Pyodide in browser?

I managed to run Pyodide in browser. I created hello.txt file. But how can I access it. Pyodide https://github.com/iodide-project/pyodide/blob/master/docs/using_pyodide_from_javascript.md pyodide.runPython('open("hello.txt", "w")') What I tried in…
krmani
  • 536
  • 5
  • 17
6
votes
1 answer

Run pytorch in pyodide?

Is there any way I can run the python library pytorch in pyodide? I tried installing pytorch with micropip but it gives this error message: Couldn't find a pure Python 3 wheel for 'pytorch'
Emmanuel
  • 129
  • 1
  • 6
5
votes
3 answers

How can I do HTTP POST requests on Pyodide

In pyodide, it is not support the requests module so to fetch the data from api we used open_url and how can we use the api for post the Data using pyodide
user
  • 61
  • 1
  • 4
4
votes
2 answers

Read a file line by line in Pyodide

The code below reads the user-selected input file entirely. This requires a lot of memory for very large (> 10 GB) files. I need to read a file line by line. How can I read a file in Pyodide one line at a time? …
Timur Shtatland
  • 12,024
  • 2
  • 30
  • 47
4
votes
2 answers

Pyodide filesystem for NLTK resources : missing files

I am trying to use NLTK in browser, thanks to pyodide. Pyodide starts well, manages to load NLTK, print its version. Nevertheless, while the package downloading seems fine, when invoking nltk.sent_tokenize(str), NLTK raises the error that it can't…
Sylvain
  • 679
  • 9
  • 13
3
votes
1 answer

How to read an excel file from a local directory using

Requirement : I want to read a excel file from my local directory by using Problem Statement : py-script runs under their own environment. Hence, It is not able to locate the current working directory and when I trying to see the current…
Debug Diva
  • 26,058
  • 13
  • 70
  • 123
3
votes
1 answer

Switch/Change the version of Python in pyscript

I am just started looking/experimenting pyscript as per the current python code which is running on Python 3.6.0. But looks like pyscript loads the python version along with Pyodide and it is retuning the latest stable version based on the Pyodide…
Debug Diva
  • 26,058
  • 13
  • 70
  • 123
3
votes
1 answer

How to use sqlalchemy via pyodide

I understand that with Pyodide I can: A) install a pure Python package via micropip from PyPI or a URL to a .whl file Example: pyodide.runPythonAsync(` import micropip await micropip.install('pyicloud') `); B)…
clstaudt
  • 21,436
  • 45
  • 156
  • 239
3
votes
1 answer

How to use pyodide function more one times

I want run funcion to stemm each row of a table. I want do it after of HTML code is loaded, I try this
lino
  • 163
  • 2
  • 10
3
votes
1 answer

Is it possible to build python wheel in browser using wasm for pyodide?

I have implemented pyodide in browser for small web apps. Some python package have no pure python wheel so I have built locally then uploaded to CDN. This python wheel can be installed using micropip in pyodide. So my questions, is there way to…
krmani
  • 536
  • 5
  • 17
3
votes
1 answer

How do I import modules in a project using pyodide without errors?

Whenever I import python modules in a pyodide, it gives this error. pyodide.js:108 Invalid package name or URI I am not sure how to properly import modules, I have tried this which was mentioned in the docs. pyodide.loadPackage('') …
2
votes
1 answer

Is there a way to change the html textContent from inside the pyodide runPython function?

So for example I have a for loop inside my pyodide script that is inside my .html document. Is there a ways to change textContent of a div directly from pyodide for loop. In the example below, only the last value of the for loop (in my case 99) is…
LuxGOD
  • 33
  • 3
2
votes
1 answer

Manually trace function in Pyodide without locking main thread

I am trying to build a browser-based debugging tool for Python but I am having trouble combining the Python inner workings with user interactions. My setup looks like this (jsfiddle link). Essentially I am using sys.settrace to inspect a function…
Blupper
  • 378
  • 2
  • 10
2
votes
0 answers

Pyodide in Node as a Python Sandbox

I am planning to use pyodide inside of node as a sandbox for running (testing and analyzing) Python code on a server. The Python code will be written by students. It will be submitted through a web interface. Although the system is not open to the…
tglas
  • 949
  • 10
  • 19
1
2 3 4 5 6 7 8