Python in windows 10

I’m having trouble getting python to execute commands from the “Developer Quickstart” page in the openAI playground. I’ve followed the install guide for windows on the python website and can’t seem to get things going. Can someone help? I keep getting syntax errors.

If you post the errors we can help

1 Like
>>> import openai
>>> openai.api_key = os.getenv("MY_KEY")
>>> openai api completions.create -e davinci -p "This is a test" -M 5 --stream
  File "<stdin>", line 1
    openai api completions.create -e davinci -p "This is a test" -M 5 --stream
           ^
SyntaxError: invalid syntax

You’re switching between Python and command line is the problem.

1 Like

Neither seem to work… what is the correct procedure? I’m missing something obvious, but it’s not obvious if you know what I mean.

1 Like

Are you new to python and coding? You’ll get better help if you post full examples of the code you’re running as well as full error messages. It’s not clear what you’re doing so it’s impossible to say what you’re doing wrong.

1 Like