openai / openai-python

The official Python library for the OpenAI API
https://pypi.org/project/openai/
Apache License 2.0
22.26k stars 3.08k forks source link

the latest openai version has problem with httpx library when compile to app. #1765

Open Pjumpod opened 1 day ago

Pjumpod commented 1 day ago

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

Describe the bug

I found this error when update the openai to new version.

Referenced from: <198A9232-F82E-3E0A-92CB-D131D45DBB4F> /xx/_ssl.cpython-312-darwin.so Expected in: <284AF566-569A-311D-8493-DC6928BBD628> /xx/libcrypto.3.dylib Failed to execute script 'main' due to unhandled exception: dlopen(/xxx/Frameworks/lib-dynload/_ssl.cpython-312-darwin.so, 0x0002): Symbol not found: _X509_STORE_get1_objects

File "openai/init.py", line 8, in File "openai/types/init.py", line 5, in File "openai/types/batch.py", line 7, in File "openai/_models.py", line 26, in File "openai/_types.py", line 21, in File "httpx/init.py", line 2, in

To Reproduce

  1. write a sample code and import the latest openai.
  2. compile file with pyinstaller on macOS.
  3. run the execute file and found this issue.

Code snippets

the problem looks lead to httpx library which calling by openai.
Not sure if it need the specific version or latest version of the library?

OS

macOS

Python version

Python 3.12

Library version

openai 1.50.2

RobertCraigie commented 1 day ago

Thanks for the report @Pjumpod, what version was last working for you?

Pjumpod commented 1 day ago

Thanks for the report @Pjumpod, what version was last working for you?

Thank you for asking. My latest work version is openai 1.47.0 and cryptography 43.0.0 but I cannot recall the httx version.

ps: it has no issue if run by python.