Sublime Forum

Why i can't use input() for python version 3, and it only accepts raw_input?

#1

So i have subslime text version 3.1, when i try to use input(), it doesn’t let me. Then i try to use raw_input(), and it works. But i thought raw_input only works for python version 2. Please let me know if something is wrong with my subslime text. Thank you

0 Likes

#2

When you run programs (e.g. Python programs) in Sublime, all Sublime does is use some external program to execute the code. In the case of Python, it executes the command python to run the script.

Your problem sounds like you have multiple versions of Python installed and Sublime is executing the wrong one. In particular it’s often the case that python executes Python version 2 while python3 is needed to execute Python version 3, or similar.

As a test, I would suggest trying to run the following script from Sublime to verify that it’s running the version of Python that you think it is:

import sys

print(sys.version)
0 Likes