mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-07 03:18:23 -05:00
[GH-ISSUE #23997] issue: black library dependency issues in pyodide-lock.json #58814
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Magwari on GitHub (Apr 22, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/23997
Check Existing Issues
Installation Method
Git Clone
Open WebUI Version
v0.9.1
Ollama Version (if applicable)
No response
Operating System
Rocky 9
Browser (if applicable)
No response
Confirmation
README.md.Expected Behavior
Non-admin users can create tools in a Pyodide environment with properly imported dependency modules.
Actual Behavior
While creating a tool, pyodide raises an exception indicating it cannot find 'click', which is a dependency of black.
Steps to Reproduce
I installed Open WebUI from source.
My environment is offline, so I need to bring it in after vite build.
send to offline server...
then make non-admin user and make tool.
Logs & Screenshots
Unfortunately, I'm unable to provide the internal logs due to company security policies. My apologies for the inconvenience.
Additional Information
This issue is likely related to modifying prepare-pyodide.js to allow loading the black library in offline environments (see https://github.com/open-webui/open-webui/issues/22509). The problem occurs when writing libraries fetched from PyPI into the pyodide-lock.json file.
Missing Dependencies in pyodide-lock.json: The black library entry does not include its required dependencies (click, mypy-extensions, packaging, pathspec, platformdirs, pytokens) in the depends field.
Package Name Inconsistency: The package name in pyodide-lock.json uses underscores (mypy_extensions) while micropip expects hyphens (mypy-extensions), causing lookup failures.
I have successfully resolved the issue by modifying the build/pyodide/pyodide-lock.json file as shown below. After this change and adding pytokens(add pypi library list in prepare-pyodide.js), pyodide can now properly load the black library and its dependencies in my enviornment.
script/prepare-pyodide.js needs to be updated to address the above issues when fetching libraries from PyPI during the build process.
@tjbck commented on GitHub (Apr 24, 2026):
pytokensadded.