


ModuleNotFoundError: No module named pkg_resources, include setuptools in your <pv-env> tag before the package you're trying to install. The package you're trying to use is assuming pkg_resources (part of the setuptools module) is always available, which isn't necessarily the case.


py-script py-repl py-env py-box py-button py-title py-inputbox py-register-widget py-loader and py-config. https://github.com/pyscript/pyscript/blob/698478ef95b396a5de4b9b330dbd9bd796d3861f/pyscriptjs/src/main.ts#L15-L24
from js import Object
to_js(your_dictionary, dict_converter=Object.fromEntries) (edited)
let pyodide = await loadPyodide();pyodide.loadPackage("numpy");pyodide.runPython(`
import sys
sys.version
`)
more - https://pyodide.org/en/stable/usage/quickstart.html#accessing-python-scope-from-javascript
from js import document, console
import io
import re
import base64
from PIL import Image
img2Bytes = document.getElementById("image").src
image_b64 = re.sub('^data:image/.+;base64,', '', img2Bytes) # .decode('base64')
image_data = base64.b64decode(image_b64)
g_image = Image.open(io.BytesIO(image_data))
# Log some of the image data for testing
console.log(f"{g_image.format= } {g_image.width= } {g_image.height= }")
if anyone has any suggestions for optimising this code, please let me know. (edited)

