Ok, so short of the long: I was using an old version of OpenAI. But it would not upgrade, because the latest version of python I had running was Python 3.8.
I upgraded Python, created a virtual environment, and installed openai 0.25.0 using pip.
The old version of Python was preventing openai package from updating past something insanely old like 0.8.0, which did not have the Image functions.
Now we’re off to the races. Thank you @vaibhav.garg !
I tried every thing mentioned above but I still get error
File “C:\Users\DELL\OneDrive\Documents\leet_python\openai.py”, line 5, in
response = openai.Image.create(
AttributeError: partially initialized module ‘openai’ has no attribute ‘Image’ (most likely due to a circular import)
I am using openai version 0.26.5 and python version 3.9.7
Complete program is
import openai
PROMPT = “An eco-friendly computer from the 90s in the style of vaporwave”
openai.api_key = “■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■45rVGzyG”
print(openai.api_key)
response = openai.Image().create(
prompt=PROMPT,
n=1,
size=“256x256”,
)
print(response[“data”][0][“url”])