I got error while running python code in MacOS, with openAI package upgrade already to the latest version. The last version of openai package does not have this issue.
import openai
import os
openai.api_key = “openai-key”
Make sure there’s no file named openai.py other than the module.
Also share the stack trace for this error. It’ll look like this:
Traceback (most recent call last):
File "example.py", line 7, in <module>
result = divide(5, 0)
File "example.py", line 2, in divide
return a / b
ZeroDivisionError: division by zero