AttributeError: module 'openai' has no attribute 'openai_response'

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”

openai.File.create(
file=open(“example.jsonl”, “rb”),
purpose=‘fine-tune’
)

1 Like

the the

import os

that could be giving u problems it can create pylons problems and syntax errors

tho if u post the full script we could probly help alittle more

Hi @michael.simpson555

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