mirror of
https://github.com/open-webui/open-webui.git
synced 2026-03-10 07:43:10 -05:00
issue: ModuleNotFoundError on code intepreter #5728
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 @sanchitbhavsar on GitHub (Jul 9, 2025).
Check Existing Issues
Installation Method
Git Clone
Open WebUI Version
v0.6.15
Ollama Version (if applicable)
No response
Operating System
macOS
Browser (if applicable)
Chrome
Confirmation
README.md.Expected Behavior
When asking model to generate pdf file with code interpretor, when executing resuslt in error (Pyodide enabled)
model: gpt-4.1
query: "generate pdf file with random username rows to"
Actual Behavior
output: Certainly! Here’s sample Python code to generate a simple “Guide” PDF using ReportLab. You can copy, tweak, and run this on your machine to create the guide.
`
from reportlab.lib.pagesizes import letter
from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle
from reportlab.lib.styles import getSampleStyleSheet
from reportlab.lib import colors
Create the PDF document
doc = SimpleDocTemplate("sample_guide.pdf", pagesize=letter)
styles = getSampleStyleSheet()
elements = []
Title
elements.append(Paragraph("Quick Guide to Using Your PDF", styles['Title']))
elements.append(Spacer(1, 24))
Introduction Paragraph
intro = ("This guide provides quick instructions on how to use your newly generated PDF document. "
"You will learn to view, print, and share this file.")
elements.append(Paragraph(intro, styles['Normal']))
elements.append(Spacer(1, 18))
Table Example
table_data = [
['Step', 'Description'],
['1', 'Download the PDF file to your device.'],
['2', 'Open the PDF using any PDF reader (such as Adobe Reader or your browser).'],
['3', 'Review the content and print if necessary.'],
['4', 'Share the PDF via email or other means if required.']
]
table = Table(table_data, hAlign='LEFT')
table.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,0), colors.HexColor('#dbeafe')),
('TEXTCOLOR',(0,0),(-1,0),colors.HexColor('#1e3a8a')),
('ALIGN',(0,0),(-1,-1),'LEFT'),
('GRID', (0,0), (-1,-1), 1, colors.grey),
('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'),
]))
elements.append(table)
elements.append(Spacer(1, 18))
Tips Section
elements.append(Paragraph("Tips:", styles['Heading2']))
elements.append(Paragraph(
"- Keep a backup of your PDF.
"
"- Make sure your device has a PDF reader installed.
"
"- For best print quality, use high-resolution settings.",
styles['Normal'])
)
Build the PDF
doc.build(elements)
print("PDF guide 'sample_guide.pdf' created successfully.")
`
on running in chat (Pyodide)
Steps to Reproduce
model: gpt-4.1
query: "generate pdf file with random username rows to"
Logs & Screenshots
STDOUT/STDERR PythonError: Traceback (most recent call last): File "/lib/python312.zip/_pyodide/_base.py", line 597, in eval_code_async await CodeRunner( File "/lib/python312.zip/_pyodide/_base.py", line 411, in run_async coroutine = eval(self.code, globals, locals) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "<exec>", line 1, in <module> ModuleNotFoundError: No module named 'reportlab'Additional Information
No response
@tjbck commented on GitHub (Jul 9, 2025):
reportlabis not shipped with pyodide, you should use jupyter engine instead.