-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Description
Please document whether Node is supported and if so, please provide an example. This example failed for me:
const { loadPyodide } = require("pyodide");
async function hello_python() {
let pyodide = await loadPyodide();
await pyodide.loadPackage("micropip");
const micropip = pyodide.pyimport("micropip");
await micropip.install("requests");
return pyodide.runPythonAsync(`
# 1. Install this package
import micropip
await micropip.install('pyodide-http')
# 2. Patch requests
import pyodide_http
pyodide_http.patch_all() # Patch all libraries
# 3. Use requests
import requests
response = requests.get('http://www.google.com/')
`);
}
hello_python().then((result) => {
console.log("Python says that the lineup is", result);
});
Node.js v18.12.1
Error:
: Failed to establish a new connection: [Errno 50] Protocol not available'))
Or with https:
Can't connect to HTTPS URL because the SSL module is not available.
Versions:
"fs": "^0.0.1-security",
"node-fetch": "^3.3.0",
"pyodide": "^0.21.3"
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels