Skip to content

Slow import times #2339

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

Open
1 task done
serozhenka opened this issue May 3, 2025 · 0 comments
Open
1 task done

Slow import times #2339

serozhenka opened this issue May 3, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@serozhenka
Copy link

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

On average, it takes nearly 0.5 seconds to just import openai.

That may sound normal, but consider the case where a bunch of deps are imported and each one of them takes 0.5 seconds to be imported. Startup times of such an application go crazy.

To Reproduce

import time

start = time.time()
import openai

print(time.time() - start)

Alternatively, run:

python -X importtime -c "import openai"

Code snippets

OS

macOS

Python version

3.11.9

Library version

1.75.0

@serozhenka serozhenka added the bug Something isn't working label May 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant