+
95
-

python的openai报错AttributeError: module 'openai' has no attribute 'Image'

python的openai报错AttributeError: module 'openai' has no attribute 'Image'

#!/usr/local/python3/bin/python3
# -*- coding: utf-8 -*
import openai
openai.api_key = "openai-key"

esponse = openai.Image.create(
  prompt="a white siamese cat",
  n=1,
  size="1024x1024"
)
image_url = response['data'][0]['url']


网友回复

+
15
-

python 3.7.0,只支持openai=0.8,而 openai 0.25.0 最低版本要求 python>=3.7.1

我知道答案,我要回答