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
2 answers

ModuleNotFoundError: No module named 'psycopg2' by using Pyodide

I have only added this code to the *ts file of this repository(https://github.com/ibdafna/webdash) which works fine in my conda environment. from sqlalchemy.engine.create import create_engine import pandas as pd from datetime import datetime url =…
RenzoG
  • 31
  • 5
1
vote
2 answers

How to show console output in HTML body

I'm making an online Python editor. And when I'm trying to print the console's output to the HTML body using document.write(), it is showing undefined Code : var py async function ld() { py = await loadPyodide({ indexURL:…
lunix
  • 151
  • 1
  • 14
1
vote
1 answer

Cannot install modules using micropip (Pyodide 0.19.0)

I am facing an error of "ImportError: cannot import name 'fetch' from 'js' (unknown location)" whenever I try to install any module in pyodide. Initially, I tried the following lines of code : await pyodide.loadPackage('micropip') await…
1
vote
1 answer

Pyodide runPythonAsync to html document

I am trying to run a simple pyodide example, but am not too familiar with javascript or pyodide and am not sure why the output is undefined. The statement is executed fine as I can see the correct output in the console log, but I cannot assign the…
JLJ
  • 77
  • 6
1
vote
1 answer

How to build pyodide for iOS 12?

Pyodide is working on iOS v13 and v14 but sometimes I get following errors on iOS v13. It is out of memory errors. Current pyodide size is approx. 25MB. So, are there any way to get rid of these errors? How can I build for very minimum usage not…
krmani
  • 536
  • 5
  • 17
1
vote
1 answer

AttributeError: format not found - pyodide + joblib.dump + scikit-learn (TfidfVectorizer)

I have pickled a SMS spam prediction model using pickle. Now, I want to use Pyodide to load the model in the browser. I have loaded the pickled file using pickle.loads in the browser: console.log("Pyodide loaded, downloading pretrained ML…
FastDeveloper
  • 367
  • 5
  • 15
1
vote
1 answer

Replicating a Python workflow for pre-processing of an image for Tensorflow in a Javascript environment

In my python code, I'm pre-processing an image and feeding it to a model for predictions.: path = "/Users/iamreddy831/Desktop/ArchitecturalStyle_ML/FinalTests/testimage3.jpg" styles = ["Baroque", "NeoClassical", "Gothic", "Modern", "Victorian"] def…
1
vote
1 answer

What are the security risks associated with WASM?

Using Deno you can execute WASM on a server. WASM is sandboxed for the user's safety. From my understanding, WASM code cannot do HTTP requests or modify the DOM. Is safety guaranteed server side too? I'm looking to run arbitrary Python code from…
user82395214
  • 829
  • 14
  • 37
1
vote
1 answer

Why is the wep page with pyodide and python module failed to load on iOS, but it can load on Android and Desktop?

I have create a simple app using pyodide to export Anki deck from csv, tsv or text file. It is working fine on desktop and android. But the page failed to load on iOS. What is the reason and how can I solve this? Links to my webpage containing…
krmani
  • 536
  • 5
  • 17
1
vote
2 answers

Pyodide - How to print results

I do know a bit of Python, am however new to Pyodide and have no experience in Javascript. I am looking for an easy way to display results in the browser: %% md a + b = HERE_I_WANT_TO_DISPLAY_THE_RESULT %% py import numpy as np a =…
K1K1
  • 19
  • 5
0
votes
0 answers

Replace my textarea output with Pyodide Console

I am creating a Pyodide Ace-editor Python code runner in which anything that is typed within ace pyodide will run. It works pretty well, however I am having an incredible amount of difficulty trying to put keyinterrupts in my current implementation…
Cr3jus
  • 1
  • 1
0
votes
1 answer

How can I run python files that I wrote into Pyodides file system?

I am writing a Pyodide based text editor that will run test scripts, when a user types into the editor, using ace-editor, I grab whatever the user types and write it into a python file using pyodides pyodide.FS.writeFile() function, I do the same…
Cr3 D
  • 153
  • 6
0
votes
1 answer

How to load my own custom python packages into Pyodide using javascript?

//fileSaver is used to save the code to a file and download it const fileSaver = require('file-saver'); // Setup ace variables and the output pane for pyodide var editor = ace.edit("editor"); var output_pane; // manual file paths for testing var…
Cr3 D
  • 153
  • 6
0
votes
1 answer

Import boto3 into my project built with pyodide (unhelpful errors)

I've tried a number of things trying to import boto3 into a project I'm contributing to (thats built with pyodide)but keep receiving unhelpful errors. Is this a syntax issue or something more? This is the top half of index.html where I'm trying to…
Stan
  • 1
  • 1
0
votes
1 answer

How can I make loadPyodide() available to any component?

Using Vue with Pinia, is it possible to load loadPyodide() into Pinia and assign it to a variable, so that components can use runPython()? For example, in Pinia, I have this code where I am assigning loadPyodide() to the variable pyodide: In file…
rafaelcb21
  • 12,422
  • 28
  • 62
  • 86