0

I just got python and sublime 3. When I press control + b, I get this in the console:

'python' is not recognized as an internal or external command, operable program or batch file.

And it won't run my amazing code!

print"Hi"

I do have Python installed, and how do I change the PATH?

Jongware
  • 22,200
  • 8
  • 54
  • 100
CJ.
  • 75
  • 1
  • 2
  • 8

1 Answers1

4

If you installed Python 2, you'll need to just go ahead and install Python 3, as it's the present and future of the language. Don't starting learning Python with 2, you'll pick up all sorts of bad habits. Learn with 3, then go back and find out the differences with 2 when you can understand them. I'm assuming you're on a 64-bit system, as everything is these days, so download Python 3 from here. If you're not, get this one. Run the installer, and pick the option (I forget exactly where it is) that says "Add Python to my PATH". Finish the installation, restart Sublime, and it should pick up python.exe just fine.

BTW, in Python 3, print is a function, so your first code to run should be

print("Hi!")

Don't forget to save the file before building.

Oh yeah, avoid "Learn Python the Hard Way" like the plague. It sucks. Instead, read the official tutorial first, then pick something here and/or here.

MattDMo
  • 100,794
  • 21
  • 241
  • 231
  • I found two tutorials that both use python 2, so I uninstalled 3, because all the learning things were for two. So fine, I'll get 3. – CJ. Apr 16 '16 at 02:45
  • @CJ: Don't. Your question, *as it stands*, got answered. – Jongware Apr 16 '16 at 03:18
  • @Rad Lexus Don't what? – CJ. Apr 16 '16 at 03:19
  • @CJ. BTW, you can have both 2 and 3 installed at the same time. I just strongly recommend using 3 primarily. – MattDMo Apr 16 '16 at 03:23
  • 1
    @CJ: change your question to something entirely new. Stack Overflow is a site for *questions* and *answers*. After getting an answer, you changed the question to ask something new, which invalidated the answer. – Jongware Apr 16 '16 at 03:23