Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No module named 'openai._legacy_response' #234

Open
maximepeabody opened this issue Jun 4, 2024 · 3 comments
Open

No module named 'openai._legacy_response' #234

maximepeabody opened this issue Jun 4, 2024 · 3 comments
Labels
Bug Bug related to the Logfire Python SDK OpenAI OpenAI instrumentation related

Comments

@maximepeabody
Copy link

Description

I'm trying to integrate with openai. I have openai==1.3.5

I'm seeing this error:

No module named 'openai._legacy_response'

My code is like:

openai_client = openai.Client()
logfire.configure()
logfire.instrument_openai(openai_client)

Python, Logfire & OS Versions, related packages (not required)

logfire="0.39.0"
platform="macOS-14.4-arm64-arm-64bit"
python="3.10.14 (main, May 24 2024, 14:58:47) [Clang 15.0.0 (clang-1500.3.9.4)]"
[related_packages]
requests="2.31.0"
pydantic="2.7.0"
fastapi="0.109.2"
openai="1.3.5"
protobuf="4.25.3"
rich="13.7.1"
tomli="2.0.1"
executing="2.0.1"
opentelemetry-api="1.25.0"
opentelemetry-exporter-otlp-proto-common="1.25.0"
opentelemetry-exporter-otlp-proto-http="1.25.0"
opentelemetry-instrumentation="0.46b0"
opentelemetry-instrumentation-asgi="0.46b0"
opentelemetry-instrumentation-fastapi="0.46b0"
opentelemetry-proto="1.25.0"
opentelemetry-sdk="1.25.0"
opentelemetry-semantic-conventions="0.46b0"
opentelemetry-util-http="0.46b0"
@maximepeabody maximepeabody added the Bug Bug related to the Logfire Python SDK label Jun 4, 2024
@alexmojaki
Copy link
Contributor

1.3.5 is more than 7 months old (see https://pypi.org/project/openai/1.3.5/), while the latest release is 1.31.0. Any chance you can just upgrade openai?

@Kludex Kludex added the OpenAI OpenAI instrumentation related label Jun 4, 2024
@maximepeabody
Copy link
Author

Just tried upgrading, but that didn't work either. I actually had it to 1.31.0 originally, and I was testing out if downgrading would fix it!

@alexmojaki
Copy link
Contributor

If I run this code:

import openai
print(openai.__version__)
import openai._legacy_response

it prints 1.31.0 and there's no error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Bug related to the Logfire Python SDK OpenAI OpenAI instrumentation related
Projects
None yet
Development

No branches or pull requests

3 participants