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?

8
  • Do you have Python installed? Commented Apr 16, 2016 at 1:42
  • 1
    You likely need to add python to your system PATH Commented Apr 16, 2016 at 1:43
  • Sounds like your on Windows, so try this How to add to the pythonpath in windows 7? Commented Apr 16, 2016 at 1:52
  • Add the full path to python.exe in Sublime Text so it doesn't have to search. Commented Apr 16, 2016 at 1:53
  • When you installed Python, you should have been asked if you wanted it added to the PATH environment variable. Commented Apr 16, 2016 at 1:55

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

5 Comments

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: Don't. Your question, as it stands, got answered.
@Rad Lexus Don't what?
@CJ. BTW, you can have both 2 and 3 installed at the same time. I just strongly recommend using 3 primarily.
@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.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.