'No module named openai
I feel dumb asking this question but I've searched everywhere and have followed the steps and can't figure out what is wrong.
I've installed openai on my laptop pip install openai.
Have installed on my laptop and after installed on the same folder where my code file is. But when I try to run the code I get ImportError: No module named openai
This is the code from the file. Pretty simple:
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)
What am I doing wrong?
Appreciate your time.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
