feat: pyodide - load additional packages by name/URL #3176

Open
opened 2025-11-11 15:24:47 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @idling-mind on GitHub (Jan 3, 2025).

Originally assigned to: @tjbck on GitHub.

Feature Request

Specify additional packages for pyodide/micropip to load either by name or by url

Is your feature request related to a problem? Please describe.
I tried my best to configure pyodide to load additional package. In my case, I wanted to load a local package which is not uploaded to pypi. Even tried to compile pyodide with additional packages. It was cumbersome and I didnt succeed.

Describe the solution you'd like
Have a section either in workspace or admin settings where I can specify settings related to pyodide (or in-browser code execution. In this settings, i'd like to add a list of additional packages to load which micropip supports. This could either be by name or by url.

Describe alternatives you've considered
Building pyodide with additional packages myself and getting open-webui to load that version of pyodide.

Additional Notes
I tried hosting the wheel from a local url and run the following. That worked for me.

import micropip
await micropip.install("http://local_address:8888/mypackage-0.1.0-py3-none-any.whl")
import mypackage
print(mypackage)

However, when I tried to import matplotlib, it complained. SyntaxError: 'await' outside function

Originally created by @idling-mind on GitHub (Jan 3, 2025). Originally assigned to: @tjbck on GitHub. # Feature Request Specify additional packages for pyodide/micropip to load either by name or by url **Is your feature request related to a problem? Please describe.** I tried my best to configure pyodide to load additional package. In my case, I wanted to load a local package which is not uploaded to pypi. Even tried to compile pyodide with additional packages. It was cumbersome and I didnt succeed. **Describe the solution you'd like** Have a section either in workspace or admin settings where I can specify settings related to pyodide (or in-browser code execution. In this settings, i'd like to add a list of additional packages to load which micropip supports. This could either be by name or by url. **Describe alternatives you've considered** Building pyodide with additional packages myself and getting open-webui to load that version of pyodide. **Additional Notes** I tried hosting the wheel from a local url and run the following. That worked for me. ```python import micropip await micropip.install("http://local_address:8888/mypackage-0.1.0-py3-none-any.whl") import mypackage print(mypackage) ``` However, when I tried to import matplotlib, it complained. `SyntaxError: 'await' outside function`
Author
Owner

@silentoplayz commented on GitHub (May 28, 2025):

Related - https://github.com/open-webui/open-webui/issues/3583

@silentoplayz commented on GitHub (May 28, 2025): Related - https://github.com/open-webui/open-webui/issues/3583
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#3176