You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
@RobertCraigie
Yeah, much better, down to .25s on average. Appreciate the work on the lazy imports.
I think it can still be further improved by not trying to import from all of the modules in root __init__.py, but this would affect too many people to even be discussed, I guess.
Activity
RobertCraigie commentedon May 6, 2025
@serozhenka can you try the latest changes in #2340?
serozhenka commentedon May 6, 2025
@RobertCraigie
Yeah, much better, down to .25s on average. Appreciate the work on the lazy imports.
I think it can still be further improved by not trying to import from all of the modules in root
__init__.py, but this would affect too many people to even be discussed, I guess.RobertCraigie commentedon Jun 9, 2025
Yeah I think we're at the limit for what we can improve right now without sweeping breaking changes unfortunately.
jmathes commentedon Jan 12, 2026
Created a similar bug, likely with a different cause but similar symptoms: 2819