1

I'm trying to get python to work in Sublime but it just won't. This is what I'm getting: below

'py' is not recognized as an internal or external command,
operable program or batch file.
[Finished in 0.1s with exit code 1]
[shell_cmd: py -3 -OO -u "C:\Users\NAME REDACTED\Desktop\tetris.py"]
[dir: C:\Users\NAME REDACTED\Desktop]
[path: C:\Python\Python37]

The python path is the right place. I can get it to work on Pyzo and Atom, but I'm stubborn and really want sublime. Could someone please help me?

EllaSolar
  • 51
  • 4
  • 2
    I don't think the `py.exe` command is in the same place as the the Python interpreter `python.exe` on Windows systems—so your path may not be set correctly. On my system it's in the `C:\Windows` directory. It's also possible that you should be running `python` instead of `py`—the latter being a launcher convenience utility. – martineau Feb 13 '19 at 23:10
  • 1
    Hi @martineau! Can I ask what you mean by "should be running python instead of py"? – EllaSolar Feb 13 '19 at 23:36
  • I meant maybe the scripts should be run using the command **`python`** instead of **`py`**. Here's a [link](https://stackoverflow.com/questions/52617010/why-is-python-broken-in-visual-studio-2017/53136433#53136433) to an answer describing what the `py` command is and does. I believe there's some configuration setting in sublime that controls what command is used to run Python scripts (I haven't used sublime myself in a long time—and that it was only version 2). – martineau Feb 13 '19 at 23:40
  • 1
    These google search results for [how to configure sublime 3 to run python 3](https://www.google.com/search?hl=en&as_q=how+to+configure+sublime+3+to+run+python+3&as_epq=&as_oq=&as_eq=&as_nlo=&as_nhi=&lr=&cr=&as_qdr=all&as_sitesearch=&as_occt=any&safe=images&as_filetype=&as_rights=) might be helpful. – martineau Feb 13 '19 at 23:59
  • Read more about [Build Systems](https://www.sublimetext.com/docs/3/build_systems.html) and how can you configure yours custom. – Dinko Pehar Feb 14 '19 at 08:28
  • This is 100% a path issue in that `py,exe` is not in the path that you're providing to the build. You need to either find where `py,.exe` is and point the path to that location or change to `python.exe` (presuming that the binary is at the path you're using here). – OdatNurd Feb 14 '19 at 22:18

0 Answers0