JulianEberius / SublimePythonIDE

ST3 only: A rewrite of SublimeRope for ST3, uses the Rope library to add python completions and refactoring to ST3
GNU General Public License v2.0
267 stars 38 forks source link

OSError: Could not detect python... #58

Closed joostk90 closed 9 years ago

joostk90 commented 10 years ago

Hi dev Julian!

I had problems with setting the Python interpreter right on my Win7 x86 machine. I've installed a WinPython where Python is located at "C:\Program Files\WinPython-32bit-3.3.3.3\python-3.3.3\python.exe". The space in "Program Files" caused the problem. Setting the SublimePython user-settings gives me a value error window on startup. Setting it in Settings - User also doesn't do the trick. Troubleshooting the code I found that the python local on line 285 in proxy_for(view) of sublime_python.py is set to C:\\Program. Tracing the source of this value I found the following on line 225:

sys_py = sys_py.split()[0]  # use first result where many might return

But the result of the where clause in cmd contains a space! So I changed it to:

sys_py = sys_py.strip()

Now it works flawless:

started server on port 51965 with C:\Program Files\WinPython-32bit-3.3.3.3\python-3.3.3\python.exe

Might this help some others too?

JulianEberius commented 9 years ago

Hi!

Thanks for your report. I think the correct solution is to use splitlines() instead of split, as "where" on Windows returns multiple hits on multiple lines. I applied this change in the testing branch, which will be merged with master soon.

Thanks for your report!