# Python in windows 10

**URL:** <https://community.openai.com/t/python-in-windows-10/8642>\
**Category:** API\
**Created:** [August 27, 2021, 10:44pm UTC](https://community.openai.com/t/python-in-windows-10/8642 "2021-08-27T22:44:47Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![u2084511\_felix](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/u2084511_felix/32/3721_2.png) [@u2084511\_felix](https://community.openai.com/u/u2084511_felix)\
**Post date:** [August 27, 2021, 10:44pm UTC](https://community.openai.com/t/python-in-windows-10/8642/1 "2021-08-27T22:44:47Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![daveshapautomator](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/daveshapautomator/32/8779_2.png) [@daveshapautomator](https://community.openai.com/u/daveshapautomator)\
**Post date:** [August 27, 2021, 11:23pm UTC](https://community.openai.com/t/python-in-windows-10/8642/2 "2021-08-27T23:23:14Z")

</div>

If you post the errors we can help

---

<div class="post-metadata">

**Author:** ![u2084511\_felix](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/u2084511_felix/32/3721_2.png) [@u2084511\_felix](https://community.openai.com/u/u2084511_felix)\
**Post date:** [August 27, 2021, 11:35pm UTC](https://community.openai.com/t/python-in-windows-10/8642/3 "2021-08-27T23:35:29Z")

</div>

```auto
>>> 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
```

---

<div class="post-metadata">

**Author:** ![daveshapautomator](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/daveshapautomator/32/8779_2.png) [@daveshapautomator](https://community.openai.com/u/daveshapautomator)\
**Post date:** [August 27, 2021, 11:49pm UTC](https://community.openai.com/t/python-in-windows-10/8642/5 "2021-08-27T23:49:11Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![u2084511\_felix](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/u2084511_felix/32/3721_2.png) [@u2084511\_felix](https://community.openai.com/u/u2084511_felix)\
**Post date:** [August 27, 2021, 11:58pm UTC](https://community.openai.com/t/python-in-windows-10/8642/6 "2021-08-27T23:58:42Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![daveshapautomator](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/daveshapautomator/32/8779_2.png) [@daveshapautomator](https://community.openai.com/u/daveshapautomator)\
**Post date:** [August 28, 2021, 2:29am UTC](https://community.openai.com/t/python-in-windows-10/8642/7 "2021-08-28T02:29:23Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![EricGT](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/ericgt/32/20571_2.png) [@EricGT](https://community.openai.com/u/EricGT)\
**Post date:** [December 19, 2023, 7:03pm UTC](https://community.openai.com/t/python-in-windows-10/8642/9 "2023-12-19T19:03:01Z")

</div>

Closed on December 19, 2023, 7:03pm UTC


