REPL error with Sublime Text 3

ICMonster picture ICMonster · Mar 9, 2015 · Viewed 15.1k times · Source

I'm using REPL with sublime text 3 (latest version as of today) and I'm coding in python 3.4. As far as I understand the documentation on REPL if do: tools>sublimeREPL>python>python-RUN current file
then I should run the code I have typed in using REPL. However when I do this I get an error pop up saying:

FileNotFoundError(2, 'The system cannot find the file specified.',None,2)

I get this error whatever the code I typed in is (I tried print ("Hello World") on its own and also big long programs I've made before) Can someone please help me with this and explain what the problem is, thanks :)

Answer

adb16x picture adb16x · Mar 28, 2015

I also had this problem. This is most probably due to the default location of python. If you are running portable python,

{
...
"default_extend_env": {"PATH": "{PATH}:\\Programming\\Python\\Portable Python 2.7.6.1\\App\\"}
...
 } 

Otherwise,

{
"default_extend_env": {"PATH":"C:\\python27\\"},
}

would suffice. This code is to be pasted in:

Preferences -> Package Settings -> SublimeREPL -> Settings - User