[GH-ISSUE #8109] [ERROR: No module named 'open_webui.apps'] when importing a Function #134732

Closed
opened 2026-05-25 00:57:00 -05:00 by GiteaMirror · 6 comments
Owner

Originally created by @madslyng on GitHub (Dec 26, 2024).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/8109

Bug Report

Installation Method

docker run -d -p 127.0.0.1:3000:8080 -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:main

Environment

  • Open WebUI Version: Open WebUI Version
    v0.5.1
    (latest)

  • Ollama (if applicable):
    0.5.4

  • Operating System: Windows 11 WSL 2

  • Browser (if applicable): Firefox 133.0.3 (64-bit)

Confirmation:

  • I have read and followed all the instructions provided in the README.md.
  • I am on the latest version of both Open WebUI and Ollama.
  • I have included the browser console logs.
  • I have included the Docker container logs.
  • I have provided the exact steps to reproduce the bug in the "Steps to Reproduce" section below.

Expected Behavior:

Can install a Function that uses the open_webui python library

Actual Behavior:

Throws error in user interface, and fails to save Function

Description

Bug Summary:
When attempting to install a function that uses the open_webui library in the Functions code. The Open WebUI application fails to create the new function, because it cannot find open_webui

Reproduction Details

Steps to Reproduce:

  1. Discover a new Function
  2. Search for Visual Tree and pick a Function, for instance https://openwebui.com/f/zzxc/mcts/
  3. Click Get
  4. Click 'Import to WebUI`
  5. Back in WebUI you should be presented with the Function you are attempting to import.
  6. Click Save
  7. Observe toast with error message

Logs and Screenshots

Browser Console Logs:

Code formatted successfully [FunctionEditor.svelte:279:12](http://localhost:3000/src/lib/components/admin/Functions/FunctionEditor.svelte)
Object { id: "hypothesis_to_theory_reasoning", name: "Hypothesis to Theory Reasoning", meta: {…}, content: '"""\ntitle: Hypothesis to Theories (HtT) Reasoning Pipe\nversion: 1.0.1\nDescription: A Think-Respond pipe that implements Hypothesis to Theories reasoning,\n            supporting both OpenAI and Ollama models with configurable settings.\n            This approach is based on a heavily simplified version of this paper: https://arxiv.org/pdf/2310.07064 without the external database. \n            Work will continue on adding learned rules to the context window through a better pseudo-RL approach"""\n\nfrom typing import Dict, List, Optional, Callable, Any, AsyncGenerator\nfrom pydantic import BaseModel, Field\nfrom dataclasses import dataclass\nimport json\nimport asyncio\nimport logging\nfrom time import time\nfrom open_webui.utils.misc import get_last_user_message\nfrom open_webui.apps.openai import main as openai\nfrom open_webui.apps.ollama import main as ollama\n\n# Setup logging\nlogger = logging.getLogger(__name__)\nif not logger.handlers:\n    logger.setLevel(logging.DEBUG)\n    handler = logging.Str…' }
[+page.svelte:20:10](http://localhost:3000/src/routes/(app)/admin/functions/create/+page.svelte)
XHRPOST
http://localhost:3000/api/v1/functions/create
[HTTP/1.1 400 Bad Request 24ms]

Object { detail: "[ERROR: No module named 'open_webui.apps']" }

Docker Container Logs:

INFO:     172.17.0.1:38610 - "GET /_app/immutable/chunks/FunctionEditor.CckhdZhJ.js.map HTTP/1.1" 200 OK
INFO  [open_webui.utils.plugin] No requirements found in frontmatter.
ERROR [open_webui.utils.plugin] Error loading module: hypothesis_to_theory_reasoning: No module named 'open_webui.apps'
No module named 'open_webui.apps'
INFO:     172.17.0.1:38600 - "POST /api/v1/functions/create HTTP/1.1" 400 Bad Request

Screenshots/Screen Recordings (if applicable):
bug

Additional notes

I tried to docker exec with interactive mode, and manually installed open_webui: pip install open_webui

But it did not have any effect.

Originally created by @madslyng on GitHub (Dec 26, 2024). Original GitHub issue: https://github.com/open-webui/open-webui/issues/8109 # Bug Report ## Installation Method `docker run -d -p 127.0.0.1:3000:8080 -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:main` ## Environment - **Open WebUI Version:** Open WebUI Version v0.5.1 [(latest)](https://github.com/open-webui/open-webui/releases/tag/v0.5.1) - **Ollama (if applicable):** 0.5.4 - **Operating System:** Windows 11 WSL 2 - **Browser (if applicable):** Firefox 133.0.3 (64-bit) **Confirmation:** - [X] I have read and followed all the instructions provided in the README.md. - [X] I am on the latest version of both Open WebUI and Ollama. - [X] I have included the browser console logs. - [X] I have included the Docker container logs. - [X] I have provided the exact steps to reproduce the bug in the "Steps to Reproduce" section below. ## Expected Behavior: Can install a Function that uses the `open_webui` python library ## Actual Behavior: Throws error in user interface, and fails to save Function ## Description **Bug Summary:** When attempting to install a function that uses the `open_webui` library in the Functions code. The Open WebUI application fails to create the new function, because it cannot find `open_webui` ## Reproduction Details **Steps to Reproduce:** 1. Discover a new Function 2. Search for `Visual Tree` and pick a Function, for instance https://openwebui.com/f/zzxc/mcts/ 3. Click `Get` 4. Click 'Import to WebUI` 5. Back in WebUI you should be presented with the Function you are attempting to import. 6. Click `Save` 7. Observe toast with error message ## Logs and Screenshots **Browser Console Logs:** ``` Code formatted successfully [FunctionEditor.svelte:279:12](http://localhost:3000/src/lib/components/admin/Functions/FunctionEditor.svelte) Object { id: "hypothesis_to_theory_reasoning", name: "Hypothesis to Theory Reasoning", meta: {…}, content: '"""\ntitle: Hypothesis to Theories (HtT) Reasoning Pipe\nversion: 1.0.1\nDescription: A Think-Respond pipe that implements Hypothesis to Theories reasoning,\n supporting both OpenAI and Ollama models with configurable settings.\n This approach is based on a heavily simplified version of this paper: https://arxiv.org/pdf/2310.07064 without the external database. \n Work will continue on adding learned rules to the context window through a better pseudo-RL approach"""\n\nfrom typing import Dict, List, Optional, Callable, Any, AsyncGenerator\nfrom pydantic import BaseModel, Field\nfrom dataclasses import dataclass\nimport json\nimport asyncio\nimport logging\nfrom time import time\nfrom open_webui.utils.misc import get_last_user_message\nfrom open_webui.apps.openai import main as openai\nfrom open_webui.apps.ollama import main as ollama\n\n# Setup logging\nlogger = logging.getLogger(__name__)\nif not logger.handlers:\n logger.setLevel(logging.DEBUG)\n handler = logging.Str…' } [+page.svelte:20:10](http://localhost:3000/src/routes/(app)/admin/functions/create/+page.svelte) XHRPOST http://localhost:3000/api/v1/functions/create [HTTP/1.1 400 Bad Request 24ms] Object { detail: "[ERROR: No module named 'open_webui.apps']" } ``` **Docker Container Logs:** ``` INFO: 172.17.0.1:38610 - "GET /_app/immutable/chunks/FunctionEditor.CckhdZhJ.js.map HTTP/1.1" 200 OK INFO [open_webui.utils.plugin] No requirements found in frontmatter. ERROR [open_webui.utils.plugin] Error loading module: hypothesis_to_theory_reasoning: No module named 'open_webui.apps' No module named 'open_webui.apps' INFO: 172.17.0.1:38600 - "POST /api/v1/functions/create HTTP/1.1" 400 Bad Request ``` **Screenshots/Screen Recordings (if applicable):** ![bug](https://github.com/user-attachments/assets/61f5bfc0-85b9-4375-adf6-e35bc810afa3) **Additional notes** I tried to `docker exec` with interactive mode, and manually installed open_webui: `pip install open_webui` But it did not have any effect.
Author
Owner

@aiproductguy commented on GitHub (Dec 26, 2024):

I am getting the same error, but on a Mac.

<!-- gh-comment-id:2562955963 --> @aiproductguy commented on GitHub (Dec 26, 2024): I am getting the same error, but on a Mac.
Author
Owner

@tjbck commented on GitHub (Dec 26, 2024):

Deprecated function, please read the changelogs and reach out to the author.

https://docs.openwebui.com/features/plugin/migration/

<!-- gh-comment-id:2563083951 --> @tjbck commented on GitHub (Dec 26, 2024): Deprecated function, please read the changelogs and reach out to the author. https://docs.openwebui.com/features/plugin/migration/
Author
Owner

@MartianInGreen commented on GitHub (Dec 27, 2024):

Is there some guide on updating for devs? What exactly was changed? I can't find anything in the Changelog except for "Websocket support now mandatory"?

<!-- gh-comment-id:2563761743 --> @MartianInGreen commented on GitHub (Dec 27, 2024): Is there some guide on updating for devs? What exactly was changed? I can't find anything in the Changelog except for "Websocket support now mandatory"?
Author
Owner

@encryptic12 commented on GitHub (Dec 28, 2024):

Deprecated function, please read the changelogs and reach out to the author.

I have seen this response on a lot of threads. Less than helpful. Was that function replaced with something else? The following line of the changelog does not exactly provide any guidance on the issue:

Backend Overhaul for Performance: Major backend restructuring; a heads-up that some "Functions" using internal variables may face compatibility issues. Moving forward, websocket support is mandatory to ensure Open WebUI operates seamlessly.

Will the functions now have to call websockets to import the data they were getting from internal functions before? If so, doesn't this sort of negate a lot of the reason that functions exist in the first place: To take advantage of the fact that they run in OWUI and not in pipelines...?

<!-- gh-comment-id:2564453991 --> @encryptic12 commented on GitHub (Dec 28, 2024): > Deprecated function, please read the changelogs and reach out to the author. I have seen this response on a lot of threads. Less than helpful. Was that function replaced with something else? The following line of the changelog does not exactly provide any guidance on the issue: Backend Overhaul for Performance: Major backend restructuring; a heads-up that some "Functions" using internal variables may face compatibility issues. Moving forward, websocket support is mandatory to ensure Open WebUI operates seamlessly. Will the functions now have to call websockets to import the data they were getting from internal functions before? If so, doesn't this sort of negate a lot of the reason that functions exist in the first place: To take advantage of the fact that they run in OWUI and not in pipelines...?
Author
Owner

@encryptic12 commented on GitHub (Dec 28, 2024):

Ahhhh, this is much more helpful. Check out the documentation updates here: https://docs.openwebui.com/features/plugin/migration/

<!-- gh-comment-id:2564555794 --> @encryptic12 commented on GitHub (Dec 28, 2024): Ahhhh, this is much more helpful. Check out the documentation updates here: https://docs.openwebui.com/features/plugin/migration/
Author
Owner

@mdsa2 commented on GitHub (May 24, 2026):

bro i will give u soluation 100%100 that work u need go to open web ui docmenation page and then after that copy all page that in docs and put it in gemini the docs page to learn the rules he need follow up after that put your code and the problem will fixed the docs this is the easiest way
https://docs.openwebui.com/features/extensibility/plugin/functions/

<!-- gh-comment-id:4527511770 --> @mdsa2 commented on GitHub (May 24, 2026): bro i will give u soluation 100%100 that work u need go to open web ui docmenation page and then after that copy all page that in docs and put it in gemini the docs page to learn the rules he need follow up after that put your code and the problem will fixed the docs this is the easiest way https://docs.openwebui.com/features/extensibility/plugin/functions/
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#134732