getenv() fails to get environment in Sublime Text 2 (OS X)
After installing SublimeREPL in Sublime Text 2 and opening a REPL I get this error message (and a pop-up alert).
Traceback (most recent call last):
File "./repls/subprocess_repl.py", line 144, in getenv
AttributeError: 'module' object has no attribute 'check_output'
error: SublimeREPL: obtaining sane environment failed in getenv()
Check console and 'getenv_command' setting
WARN: Falling back to SublimeText environment
It seems that the python version (2.6.8) bundled with sublime text doesn't support the check_output call. Am I missing something here? I installed everything as described in the installation instructions. SublimeREPL should work out of the box (and not generate errors and pop-ups) on the most recent version of SublimeText 2 under OS X, shouldn't it?
I'm also seeing this. Did you ever find a solution @sorig?
Same issue! Any solution?
Upgrade to Sublime Text 3 if possible.
Yes, I'll do it, Thanks!
This bug affects latest version also. I analysed the issue and the bug might be related to this http://stackoverflow.com/questions/33643393/sublimerepl-getenv-failing/33651248#33651248
@sorig and @pletvanzoen did you guys ever find a solution for this bug? I'd like to develop some python using sublime but getting this error and then just 'REPL closed'.
I use sublimeREPL to write python for half of year, but I just got this error this week. It is wired...Anyone help? I really like SublimeREPL!
I'm having the same problem.
Actually, I've been happily using sulimeREPL without this for a long time, but suddenly(maybe after OX X El Captain update?) I'm having this.
Other than the error message, I have 2 more problems.
- the working directory is weird, so I have to change it.
- source buffer keys works, but don't give me echos I used to have.
Any solution?
Oh yes, forgot to mention that I'm getting this behaviour on OS X El Captain but also on Linux (Ubuntu), so I don't think it's confined to mac only. Although it may have something do with using python 2.7? Or whatever the default is.
If no one finds a solution, when I have time I'll look into forking and fixing myself and let you guys know. It seems like it shouldn't be that bad to fix, just a mismatch between versions or something similar.
Same error persisting. Any solutions yet?
Hi @paulkr, I have not dug deep enough to find a true fix. However, I did find a way to get it to be functional - even though it still throws the error message, it seems to work as intended.
Go to Preferences>Browse Packages, then open the file SublimeREPL/config/Python/Main.sublime-menu. Look for the JSON entry with "id": "rep_python_run", within that entry add an "i" to the cmd field so that it looks like this "cmd": ["python", "-u", "-i", "$file_basename"]. This keeps REPL open after running a python file instead of closing it.
Hope that helps :smile:
Same problem here, anyone had fixed this? I tried the solution http://stackoverflow.com/questions/33643393/sublimerepl-getenv-failing/33651248#33651248 but not worked for me.
It used to work properly for me but after I upgrade the system recently it is broken, not sure why. I uses OSX EI Capitan with Sublime Text 2.
I would also like to add that I am getting the same error message when starting the Haskell REPL but it starts nonetheless. However, running any shell commands via :!cmd in the REPL doesn't work, and neither does tab completion.
Hi All,
My patch works in Sublime Text 3 on OSX El Capitan. Does this work for you?
@gniquil, thank you very much for trying that.
I tested your fix on my SublimeText2, but didn't work.
Hi @totuta,
I am actually interested to know how did you try my fix? Since there's no automated tests whatsoever. I literally had to go into my local packages folder and c/p my fix into the file and experiment by restarting SB3 (too) many times. Is this what you do too? Wondering if I am doing this right.
@gniquil,
Yes, I've done exactly the same thing.
Hey @gniquil I tried ur patch of subprocess_repl.py by copying and pasting, but initially it didn't work for me because I stupidly put a stupid little "echo 'yo'" line in my ~/.bash_profile for testing, however I removed that line and it works perfectly. I would suggest to anyone with this problem, to try gniquil's patch by going into your sublime packages directory and copying and pasting the patched python code into subprocess_reply.py https://github.com/wuub/SublimeREPL/issues/458 Thanks!
Fixed for me: http://stackoverflow.com/questions/33643393/sublimerepl-getenv-failing
Don't know if there are any side effects, but I'm using the REPL for F# and it is working fine. Sublime Text 2 on OS X Yosemite
Wonder why SublimeREPL is not found by Sublime Text's package control anymore.
If I run "/bin/bash --login -c env" at a Terminal prompt, I get my environment listed.
So,Preferences > Package Settings > SublimeREPL > Settings - User, do something like this: { "getenv_command": false }