1

Basically, I've installed Sublime Text 2 to write in Python.

I then installed Package control and via package control I search "SublimeREPL" and I install the package, however even after installing, when I select Python through Tools > SublimeREPL > Python > Python, I get the error:

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

Any help please? I'm pretty new to this.

zahz
  • 99
  • 8

1 Answers1

2

Go to preferences -> Keybindings - User and paste this. Make sure there are only one set of [] in your file, if you have custom keybinds set already then add a , after your last } then paste everything but the [] at the beginning and end after your ,.

[
    { "keys": ["ctrl+shift+r"], "command": "repl_open", 
                 "caption": "Python",
                 "mnemonic": "p",
                 "args": {
                    "type": "subprocess",
                    "encoding": "utf8",
                    "cmd": ["python", "-i", "-u","$file"],
                    "cwd": "$file_path",
                    "syntax": "Packages/Python/Python.tmLanguage",
                    "external_id": "python"
                    } 
    }
]

Save and quit Sublime Text.

Follow these instructions How to add to the pythonpath in windows 7?

You should now be able to run your current file in repl with crtl+shift+r

Open sublime text and create a new file. Save it as hello.py

Type:

print('Hello World')

Save then hit ctrl-shift-r

See if that works

Community
  • 1
  • 1
Joel Green
  • 920
  • 9
  • 18
  • Open your command line and type `python` hit enter. Does it start the python interpreter? It should show something like `>>>`. If not you didn't set your python path properly. – Joel Green Nov 01 '13 at 20:40
  • I get "'python' is not recognized as an internal or external command, operable program or batch file." – zahz Nov 01 '13 at 20:45
  • The problem is your python path, not anything to do with sublime. Do you have a directory ` C:\Python27\`? Or another folder named Python something, depending on your version. – Joel Green Nov 01 '13 at 20:53
  • Yes, I have C:\Python27 – zahz Nov 01 '13 at 20:54
  • Try opening powershell and running: `[Environment]::SetEnvironmentVariable("Path", "$env:Path;C:\Python27\;C:\Python27\Scripts\", "User")` – Joel Green Nov 01 '13 at 20:57