Skip to content

Quickstart example.py ImportError #2508

@minijoo

Description

@minijoo

Confirm this is an issue with the Python library and not an underlying OpenAI API

  • This is an issue with the Python library

Describe the bug

Upon following the steps on this Quickstart guide, I get the following error on line 4:

ImportError: cannot import name 'ResponseReasoningSummaryDoneEvent' from 'openai.types.responses' (/Users/juju/workspace/pyfun/.venv/lib/python3.13/site-packages/openai/types/responses/__init__.py)

(full error pasted below)

I did some looking around to find that the directory path in the error message is a folder of "response" types, and in it I did not find "ResponseReasoningSummaryDoneEvent", but found similar ones of "Text" and "Part" varieties. So technically the error message makes sense, that it failed to import that specific event since it doesn't exist.

Types folder error refers to:
src/openai/types/responses

Going to try javascript now

To Reproduce

  1. Follow Quickstart guide setup (get API key, install openai pacakge)
  2. Run Quickstart guide example.py code

Code snippets

(.venv) juju@sys7r0 pyfun % python test2.py
Traceback (most recent call last):
  File "/Users/juju/workspace/pyfun/test2.py", line 5, in <module>
    print(client.responses)
          ^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/python@3.13/3.13.5/Frameworks/Python.framework/Versions/3.13/lib/python3.13/functools.py", line 1026, in __get__
    val = self.func(instance)
  File "/Users/juju/workspace/pyfun/.venv/lib/python3.13/site-packages/openai/_client.py", line 253, in responses
    from .resources.responses import Responses
  File "/Users/juju/workspace/pyfun/.venv/lib/python3.13/site-packages/openai/resources/responses/__init__.py", line 3, in <module>
    from .responses import (
    ...<6 lines>...
    )
  File "/Users/juju/workspace/pyfun/.venv/lib/python3.13/site-packages/openai/resources/responses/responses.py", line 40, in <module>
    from ...lib.streaming.responses._responses import ResponseStreamManager, AsyncResponseStreamManager
  File "/Users/juju/workspace/pyfun/.venv/lib/python3.13/site-packages/openai/lib/streaming/responses/__init__.py", line 1, in <module>
    from ._events import (
    ...<3 lines>...
    )
  File "/Users/juju/workspace/pyfun/.venv/lib/python3.13/site-packages/openai/lib/streaming/responses/_events.py", line 8, in <module>
    from ....types.responses import (
    ...<52 lines>...
    )
ImportError: cannot import name 'ResponseReasoningSummaryDoneEvent' from 'openai.types.responses' (/Users/juju/workspace/pyfun/.venv/lib/python3.13/site-packages/openai/types/responses/__init__.py)

OS

MacOS 12.7.6 (monterey)

Python version

python v3.13.5

Library version

openai v1.99.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions