TypeError: Can't create an SSLContext object without an ssl module #982

Closed
opened 2025-11-11 14:34:50 -06:00 by GiteaMirror · 0 comments
Owner

Originally created by @grigio on GitHub (May 20, 2024).

Bug Report

Description

Bug Summary:
it seems the generated python code can't run because a dependency is missing

Steps to Reproduce:
PROMPT: Generate an example code on how to use 'requests' and 'beautifulsoup4'

Expected Behavior:
I run the python code and I get:

PythonError: Traceback (most recent call last):
  File "/lib/python312.zip/_pyodide/_base.py", line 574, in eval_code_async
    await CodeRunner(
  File "/lib/python312.zip/_pyodide/_base.py", line 394, in run_async
    coroutine = eval(self.code, globals, locals)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<exec>", line 1, in <module>
  File "/lib/python3.12/site-packages/requests/__init__.py", line 164, in <module>
    from .api import delete, get, head, options, patch, post, put, request
  File "/lib/python3.12/site-packages/requests/api.py", line 11, in <module>
    from . import sessions
  File "/lib/python3.12/site-packages/requests/sessions.py", line 15, in <module>
    from .adapters import HTTPAdapter
  File "/lib/python3.12/site-packages/requests/adapters.py", line 75, in <module>
    _preloaded_ssl_context = create_urllib3_context()
                             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lib/python3.12/site-packages/urllib3/util/ssl_.py", line 252, in create_urllib3_context
    raise TypeError("Can't create an SSLContext object without an ssl module")
TypeError: Can't create an SSLContext object without an ssl module

Actual Behavior:
It should scrape a web page

Environment

  • Open WebUI Version: v0.1.125

  • Ollama (if applicable): 0.1.38

  • Operating System: docker on linux

  • Browser (if applicable): Firefox

Reproduction Details

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.

Logs and Screenshots

Browser Console Logs:
[Include relevant browser console logs, if applicable]

Docker Container Logs:
[Include relevant Docker container logs, if applicable]

Screenshots (if applicable):
[Attach any relevant screenshots to help illustrate the issue]

Installation Method

[Describe the method you used to install the project, e.g., manual installation, Docker, package manager, etc.]

Additional Information

[Include any additional details that may help in understanding and reproducing the issue. This could include specific configurations, error messages, or anything else relevant to the bug.]

Note

If the bug report is incomplete or does not follow the provided instructions, it may not be addressed. Please ensure that you have followed the steps outlined in the README.md and troubleshooting.md documents, and provide all necessary information for us to reproduce and address the issue. Thank you!

Originally created by @grigio on GitHub (May 20, 2024). # Bug Report ## Description **Bug Summary:** it seems the generated python code can't run because a dependency is missing **Steps to Reproduce:** PROMPT: Generate an example code on how to use 'requests' and 'beautifulsoup4' **Expected Behavior:** I run the python code and I get: ``` PythonError: Traceback (most recent call last): File "/lib/python312.zip/_pyodide/_base.py", line 574, in eval_code_async await CodeRunner( File "/lib/python312.zip/_pyodide/_base.py", line 394, in run_async coroutine = eval(self.code, globals, locals) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "<exec>", line 1, in <module> File "/lib/python3.12/site-packages/requests/__init__.py", line 164, in <module> from .api import delete, get, head, options, patch, post, put, request File "/lib/python3.12/site-packages/requests/api.py", line 11, in <module> from . import sessions File "/lib/python3.12/site-packages/requests/sessions.py", line 15, in <module> from .adapters import HTTPAdapter File "/lib/python3.12/site-packages/requests/adapters.py", line 75, in <module> _preloaded_ssl_context = create_urllib3_context() ^^^^^^^^^^^^^^^^^^^^^^^^ File "/lib/python3.12/site-packages/urllib3/util/ssl_.py", line 252, in create_urllib3_context raise TypeError("Can't create an SSLContext object without an ssl module") TypeError: Can't create an SSLContext object without an ssl module ``` **Actual Behavior:** It should scrape a web page ## Environment - **Open WebUI Version:** v0.1.125 - **Ollama (if applicable):** 0.1.38 - **Operating System:** docker on linux - **Browser (if applicable):** Firefox ## Reproduction Details **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. ## Logs and Screenshots **Browser Console Logs:** [Include relevant browser console logs, if applicable] **Docker Container Logs:** [Include relevant Docker container logs, if applicable] **Screenshots (if applicable):** [Attach any relevant screenshots to help illustrate the issue] ## Installation Method [Describe the method you used to install the project, e.g., manual installation, Docker, package manager, etc.] ## Additional Information [Include any additional details that may help in understanding and reproducing the issue. This could include specific configurations, error messages, or anything else relevant to the bug.] ## Note If the bug report is incomplete or does not follow the provided instructions, it may not be addressed. Please ensure that you have followed the steps outlined in the README.md and troubleshooting.md documents, and provide all necessary information for us to reproduce and address the issue. Thank you!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#982