Skip to content

Commit 3c1df60

Browse files
wait for micropip to load
1 parent 40c1899 commit 3c1df60

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

index.html

+6-6
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ <h1>Schemascii Playground</h1>
4343
</div>
4444
<div id="output"></div>
4545
<pre id="console"></pre>
46-
<div id="errors"></div>
46+
<pre id="errors"></pre>
4747
</body>
4848
<script>
4949
// cSpell:ignore pyodide pyproject pyimport
@@ -59,13 +59,13 @@ <h1>Schemascii Playground</h1>
5959
try {
6060
info("Loading Python... ");
6161
pyodide = await loadPyodide({ stdout: info, stderr: error });
62-
info("done\n");
63-
info("Fetching current Schemascii version... ");
62+
info("done\nINstalling micropip...");
63+
await pyodide.loadPackage("micropip");
64+
info("done\nFetching current Schemascii version... ");
6465
var pyproject_toml = await fetch("pyproject.toml").then(x => x.text());
6566
var ver = /version = "([\d.]+)"/.exec(pyproject_toml)[1];
66-
info(ver + "\n");
67-
info(`Installing schemascii-${ver}... `);
68-
await pyodide.runPythonAsync(`import micropip\nawait micropip.install("https://dragoncoder047.github.io/schemascii/dist/schemascii-${ver}-py3-none-any.whl")`);
67+
info(`${ver}\nInstalling schemascii-${ver} ... `);
68+
await pyodide.pyimport("micropip").install(`https://dragoncoder047.github.io/schemascii/dist/schemascii-${ver}-py3-none-any.whl`);
6969
schemascii = pyodide.pyimport("schemascii");
7070
await setup();
7171
console.textContent = "ready\n";

0 commit comments

Comments
 (0)