我已经在我的笔记本电脑上安装了 openai,并使用pip install openai.
已安装在我的笔记本电脑上,并安装在我的代码文件所在的同一文件夹中。但是当我尝试运行代码时我得到了ImportError: No module named openai
这是文件中的代码。很简单:
import openai
openai.api_key = API_KEY
prompt = "Say this is a test"
response = openai.Completion.create(
engine="text-davinci-001", prompt=prompt, max_tokens=6
)
print(response)
Run Code Online (Sandbox Code Playgroud)
我究竟做错了什么?