How to load and then use packages with micropip.install()

Hello @dashnabanita , and welcome to the forum! A couple of thoughts:

What errors specifically are you seeing? The errors I see (when I also include a Pyodide script tag) are:

(Warning): pyodide.asm.js:10 <exec>:5: RuntimeWarning: coroutine 'install' was never awaited
(Error): ModuleNotFoundError: No module named 'dlib'

The two are releated: micropip.install() is an async function, and must be awaited to be run. In your case, I’d add await micropip.install... and then use pyodide.runPythonAsync instead of runPython to wrap your code up into a coroutine and run it.

And because micropip.install isn’t finishing, the wheel cannot be installed, and the dlib module cannot be found.

If you do await micropip.install though, you’ll see another error:

ValueError: Wheel platform 'linux_x86_64' is not compatible with Pyodide's platform 'emscripten-3.1.27-wasm32'

Are you using the Pyodide Build package to build your custom wheel for Pyodide/Emscripten? You’ll likely want to use that to build the wheel in the correct format.

Additionally - the Pyoddie 22.0 stable release just happened/is happening today, and it looks like some of the resources are still being deployed. Just for reference - are you using v0.21.3 or trying with the new Pyodide v0.22.0?