openai-python icon indicating copy to clipboard operation
openai-python copied to clipboard

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

Open Pjumpod opened this issue 1 year ago • 2 comments

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

  • [X] This is an issue with the Python library

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

Pjumpod avatar Oct 01 '24 08:10 Pjumpod

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

RobertCraigie avatar Oct 01 '24 13:10 RobertCraigie

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.

Pjumpod avatar Oct 01 '24 16:10 Pjumpod

I do not open this issue too long, as it is not the own code of open-ai

Pjumpod avatar Nov 05 '24 07:11 Pjumpod

@Pjumpod Did you find a solution to this problem, while using python3.12?

gdagitrep avatar Dec 06 '24 05:12 gdagitrep

@Pjumpod Did you find a solution to this problem, while using python3.12?

you can use the latest version of openai. it was fixed.

Pjumpod avatar Dec 06 '24 09:12 Pjumpod