data-formulator icon indicating copy to clipboard operation
data-formulator copied to clipboard

ImportError: cannot import name 'ResponseTextConfig' from 'openai.types.responses.response'

Open Abdelkrim opened this issue 5 months ago • 4 comments

the problem

data_formulator does NOT run on WSL/Ubuntu.

how to circumvent the error?

how to get the error

I have executed the commands indicated in the documentation

# install data_formulator
pip install data_formulator

# start data_formulator
data_formulator 

# alternatively, you can run data formulator with this command
python -m data_formulator

the error

python -m data_formulator
Traceback (most recent call last):
  File "<frozen runpy>", line 189, in _run_module_as_main
  File "<frozen runpy>", line 148, in _get_module_details
  File "<frozen runpy>", line 112, in _get_module_details
  File "/home/wsluser/dev/bb/data-formulator/venv/lib/python3.11/site-packages/data_formulator/__init__.py", line 1, in <module>
    from .app import run_app
  File "/home/wsluser/dev/bb/data-formulator/venv/lib/python3.11/site-packages/data_formulator/app.py", line 38, in <module>
    from data_formulator.agent_routes import agent_bp
  File "/home/wsluser/dev/bb/data-formulator/venv/lib/python3.11/site-packages/data_formulator/agent_routes.py", line 33, in <module>
    from data_formulator.agents.client_utils import Client
  File "/home/wsluser/dev/bb/data-formulator/venv/lib/python3.11/site-packages/data_formulator/agents/client_utils.py", line 1, in <module>
    import litellm
  File "/home/wsluser/dev/bb/data-formulator/venv/lib/python3.11/site-packages/litellm/__init__.py", line 20, in <module>
    from litellm.llms.custom_httpx.http_handler import AsyncHTTPHandler, HTTPHandler
  File "/home/wsluser/dev/bb/data-formulator/venv/lib/python3.11/site-packages/litellm/llms/custom_httpx/http_handler.py", line 16, in <module>
    from litellm.litellm_core_utils.logging_utils import track_llm_api_timing
  File "/home/wsluser/dev/bb/data-formulator/venv/lib/python3.11/site-packages/litellm/litellm_core_utils/logging_utils.py", line 7, in <module>
    from litellm.types.utils import (
  File "/home/wsluser/dev/bb/data-formulator/venv/lib/python3.11/site-packages/litellm/types/utils.py", line 42, in <module>
    from ..litellm_core_utils.core_helpers import map_finish_reason
  File "/home/wsluser/dev/bb/data-formulator/venv/lib/python3.11/site-packages/litellm/litellm_core_utils/core_helpers.py", line 8, in <module>
    from litellm.types.llms.openai import AllMessageValues
  File "/home/wsluser/dev/bb/data-formulator/venv/lib/python3.11/site-packages/litellm/types/llms/openai.py", line 36, in <module>
    from openai.types.responses.response import (
ImportError: cannot import name 'ResponseTextConfig' from 'openai.types.responses.response' (/home/wsluser/dev/bb/data-formulator/venv/lib/python3.11/site-packages/openai/types/responses/response.py)

Abdelkrim avatar Aug 18 '25 17:08 Abdelkrim

Oh actually I have the same issue and it's also happening on my side, we might need to downgrade litellm version, let me take a look.

Chenglong-MS avatar Aug 18 '25 17:08 Chenglong-MS

Ok I found a temp solution: use pip install openai==1.99.9 to downgrade openai api at the moment.

It is caused by an issue from litellm that is not compatible with openai 1.100.0 version https://github.com/BerriAI/litellm/issues/13711

Chenglong-MS avatar Aug 18 '25 17:08 Chenglong-MS

I have found the solution too ... but now I can't upload a simple CSV file .... to be continued :-)

Abdelkrim avatar Aug 18 '25 17:08 Abdelkrim

keep this open until the fix is done from litellm side :)

Chenglong-MS avatar Aug 18 '25 20:08 Chenglong-MS