Previously, micropip was not able to locate shared libraries in the .libs directory of the wheel.
For instance, in Pyodide 0.25.0,
await pyodide.loadPackage("Shapely")
works, while
>>> import micropip
>>> await micropip.install("https://cdn.jsdelivr.net/pyodide/v0.25.0/full/Shapely-1.8.
2-cp311-cp311-emscripten_3_1_46_wasm32.whl")
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/lib/python3.11/site-packages/micropip/_commands/install.py", line 176, in ins
tall
await asyncio.gather(*wheel_promises)
File "/lib/python3.11/site-packages/micropip/transaction.py", line 168, in install
await self.load_libraries(target)
File "/lib/python3.11/site-packages/micropip/transaction.py", line 159, in load_libr
aries
await asyncio.gather(*map(lambda dynlib: loadDynlib(dynlib, False), dynlibs))
pyodide.ffi.JsException: Error: Didn't expect to load any more file_packager files!
does not work.
This is because micropip.install does not search the path that pyodide.loadPackage looks for.
This PR fixes it by using the same API pyodide.loadPackage is using when loading shared libraries.
Previously, micropip was not able to locate shared libraries in the
.libs
directory of the wheel.For instance, in Pyodide 0.25.0,
works, while
does not work.
This is because
micropip.install
does not search the path thatpyodide.loadPackage
looks for.This PR fixes it by using the same API
pyodide.loadPackage
is using when loading shared libraries.