Everytime I start the python within sublimeREPL package, it gives me the error,there has already been a branch of discussion of this error,and the offical document gives the following solution
"If the binary is not in your system path and you can’t or won’t change that, tweak SublimeREPL configuration:"
{
...
"default_extend_env": {"PATH": "{PATH}:/home/myusername/bin"}
...
}
I have changed the path to where the python interpreter is installed,say
{
"default_extend_env": {"PATH": "{PATH}:\\Python34"}
}
But it seems not correct, so which path name should I enter, the python interpreter path or sublimeREPL's path? And how can I find the path?Thank you
Another option is to solve this issue using symlinks. Because I am lazy and didn't want to figure out all of the places that I might need to change settings within Sublime, I just created a symbolic link between where Sublime REPL thought that the executable should be and where it actually was - that way, when Sublime REPL looks to where it thinks the executable will be the symbolic link will automatically point it in the right direction.
At least for me, this error was accompanied by a message saying where Sublime REPL had tried, unsuccessfully, to locate the python executable (in my case, Sublime REPL had tried finding it in
/Users/Ohlrogge/anaconda/bin/
). To find where the executable actually was, I used ran the following command from the terminal:This then gave me the directory the python executable is in (in this case it was, for me,
/anaconda/bin/
. Then, I just entered into the terminal:in order to create the symbolic link. Note the general syntax for
ln
command, which will work in linux or osx, is:In Windows systems, it is similar, but the order of the arguments is reversed:
See here for more on linking in windows.
You'll need to edit one of the SublimeREPL config files to point to
C:\Python34\python.exe
. First of all, though, you should addC:\Python34
to your system'sPATH
variable - google it if you don't know how. If that doesn't work (after restarting Sublime Text), do the following:Open your
Packages
folder by selectingPreferences -> Browse Packages...
. OncePackages
opens in Windows Explorer, open theSublimeREPL
folder, then theconfig
folder, then thePython
folder, then openMain.sublime-menu
in Sublime (use JSON syntax highlighting). Now, anywhere you see a"cmd"
option, inside the following brackets replace"python"
with"c:/python34/python.exe"
(remember to use forward slashes/
as the path delimiters). So, this:should be changed to:
In the section with
"caption": "Python - IPython"
, only alter the line in the"cmd"
dict starting with"windows"
(line 71). So, all in all, you should be altering lines 22, 39, 53, and 71. Save the file when you're done, restart Sublime, and SublimeREPL should now be working with Python 3.4