Sublime Forum

How to make ST run on Python instead of Rscript?

#1

The command print(“name”.title()) worked for me in Python 3.8.3 Shell, but not in ST, and after some googling I realized this is due to my ST running on Rscript instead of Python (correct me if I’m wrong).
So how do I make it run on Python? I’ve already added Python’s path to the environment variables (both user and system), but it doesn’t do anything.

Thanks

0 Likes

#2

You can select the build system under Tools > Build System > Python. Make sure your file has a .py extension.

0 Likes

#3

Okay, I did it, but after I deleted the Rscript’s path from the environment variables and ran the code again, I got the error:
" ‘Rscript’ is not recognized as an internal or external command, operable program or batch file."
Does it mean the program still thinks is supposed to run on Rscript?

0 Likes

#4

Removing it from your PATH is irrelevant if you’re still trying to run it. How are you trying to run your python script? What build system have you selected?

0 Likes

#5

I’m trying to run it with Ctrl+B, with the Python build system.
Oddly enough, now no results are appearing in the output panel at all (besides “[Finished in 0.3s]”), regardless of what code I’m writing. :confused:

0 Likes

#6

You may have the “Syntax Check” variant of the python build system selected, which won’t run your code. Use ctrl+shift+b to select the build variant.

0 Likes

#7

Thanks a lot!

0 Likes