-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mac app - Sometimes it's not possible to get the user env vars #1359
Comments
From ccordoba12 on 2013-04-23T14:31:06Z Sorry about the hassle. I introduced the _get_env function to load environment variables in the current Spyder session. The error message you saw probably means that you have none :) I already have a fix for this and will merge it before the final release. Labels: -Priority-Medium Priority-Critical MS-v2.2 OpSys-OSX |
From pierre.g...@gmail.com on 2013-04-23T15:25:23Z Thank you for your answer! I'm very much of an amateur on these topics so please excuse all the idiotic things that i will probably say. Just as a follow-up, i tried to understand what were these environment variables and if i had none as you said :) to the command
i get a consistent list of keys and values (including 'PATH', 'HOME', 'PYTHONPATH', etc.) if i comment out the following code in 'boot.py' : def _get_env():import osimport subprocess as spif os.path.isfile(os.getenv('HOME') + os.path.sep + '.profile'):envstr = sp.check_output('source /etc/profile; source ~/.profile; printenv',shell=True)else:envstr = sp.check_output('source /etc/profile; printenv', shell=True)env = [a.split('=') for a in envstr.strip().split('\n')]os.environ.update(env)_get_env()then Spyder.app launches! it seems that there nothing tragic in doing that, right?, and that it could do it for me before the final release. tell me if i'm going to hell this very minute :) merci encore!! |
From maquit...@gmail.com on 2013-04-26T11:53:35Z I had the same problem, with Mac OS X 10.7.8. The "solution" was to put all the function _get_env() between """ """ And now it works |
From ccordoba12 on 2013-04-27T07:56:24Z Guys, please help to debug this: put a print statement after the line env = [a.split('=') for a in envstr.strip().split('\n')] such as print env uncomment _get_env() and put the print contents here (which should be available in Console.app) to let me know why it's throwing an error. I thought the error was generated because there weren't env variables defined in some systems, but Pierre's comment Summary: Mac app - Can't start Spyder-2.2.0rc because of error while getting environment vars (was: Mac app - Can't install spyder-2.2.0rc_Lion.dmg on OS X 10.8.3) |
From jed.lud...@gmail.com on 2013-04-29T15:08:37Z Labels: MS-v2.2.1 |
From jed.lud...@gmail.com on 2013-04-29T15:10:06Z Labels: -MS-v2.2 |
From bor...@gmail.com on 2013-05-11T15:17:57Z I also had this issue and commenting that line fixes the issue (I used the .DMG version). Carlos, I printed the env variable just before the crash, and the problem seems to be that some sublists are emtpy: ['PIP_DOWNLOAD_CACHE', '/Users/boriel/.pip/cache'] Printing envstr shows a blank line, so a fix could be defining env as: This works, but I don't know if this is what you intented. |
From ccordoba12 on 2013-05-14T14:44:38Z I uploaded a new version that has a partial fix for this problem: at least it doesn't crash if it can't get the user env vars. Thanks boriel for your suggestion. I'll try to incorporate it for 2.2.1 after I analyze more deeply what's really happening. |
From bor...@gmail.com on 2013-05-14T14:53:43Z This fix works!! Thanks, Carlos! :) |
From ccordoba12 on 2013-06-19T18:45:20Z I'll need more time to investigate this, so I'm leaving it for 2.3 Labels: -MS-v2.2.1 MS-v2.3 |
From ccordoba12 on 2013-06-29T14:43:35Z Summary: Mac app - Sometimes it's not possible to get the user env vars (was: Mac app - Can't start Spyder-2.2.0rc because of error while getting environment vars) |
From ccordoba12 on 2013-12-11T12:41:23Z Labels: -MS-v2.3 MS-v2.3.1 |
From ccordoba12 on 2013-12-30T15:58:25Z issue #1383 has been merged into this issue. |
From ccordoba12 on 2014-08-17T18:52:50Z Labels: -MS-v2.3.1 MS-v2.3.2 |
From ccordoba12 on 2014-10-26T10:20:59Z Labels: -Priority-Critical -MS-v2.3.2 Priority-High MS-v2.4 |
From pierre.g...@gmail.com on 2013-04-19T18:12:04Z
Hi,
I can't get 'spyder-2.2.0rc_Lion.dmg' to install Spyder on my laptop running OS X 10.8.3.
(and that one last version doesn't seem to be available using macports)
Traceback (most recent call last):
File "/Applications/Spyder.app/Contents/Resources/boot.py", line 19, in
_get_env()
File "/Applications/Spyder.app/Contents/Resources/boot.py", line 18, in _get_env
os.environ.update(env)
File "os.pyc", line 479, in update
ValueError: need more than 1 value to unpack
2013-04-20 00:37:40.149 Spyder[39872:707] Spyder Error
Terminated: 15
logout
Am I missing something obvious?
thank you,
pierre
PS : I have started to use Spyder a month ago, thank you for the amazing work!!
Original issue: http://code.google.com/p/spyderlib/issues/detail?id=1359
The text was updated successfully, but these errors were encountered: