While trying to create OpenAI client, I get following error
module 'openai' has no attribute 'Client'
This is my code
import openai client = openai.Client(api_key=os.environ['OPENAI_API_KEY'],)
Output of “pip show openai”
Name: openai Version: 0.28.0 Summary: Python client library for the OpenAI API Home-page: https://github.com/openai/openai-python Author: OpenAI Author-email: email@example.com License: Location: /usr/local/lib/python3.10/site-packages Requires: aiohttp, requests, tqdm Required-by:
I have tried different version of OpenAI suggested in this thread “community.openai[dot]com/t/attributeerror-module-openai-has-no-attribute-chatcompletion/81490” but none worked.