I am new to mac and absolutely node idea why .app is not able to access
environment variables.
This is actually a Mac issue, I don't think it's either py2app and certainly not a wxPython one.
The trick is the distinction between command line apps and GUI apps.
When you run Python from the command line, you get the environment set up there -- everything that bash (or whatever) has, system env variables, stuff from your .profile, etc.
When a py2app bundle is run, it gets the environment provided for GUI apps, which certainly doesn't include anything in your .profile, ,bashrc, etc, as bash isn't involved at all. I'm a bit surprised that the there is nothing there, but I don't expect the PATH to be set, etc -- PATH is all about command line tools.
There was discussion about this sometime in the last few months on the pythonmac list -- I'd look for that, and maybe ask a question there about how to solve your particular problems.
I tried using full path of these external programs but they are also
complaining
about their own environment vars missing.
ouch, ugly!
I wonder if subprocess would work better, but I suppose you may need to somehow get a full command line environment set up to run these commands -- maybe /usr/bin/env would help? You may be able to run env inside bash, and get the users bash environment that way. ugly, I know -- I'd check the pythonmac list for a better way.
When not giving full path of external programs, I am getting an error
saying:
execvp(shaderglsl test.glsl)failed with error 2
This means .app does not understand what 'shaderglsl' is.
When using standard commands such "ifconfig eth0", .app is working fine.
This is confusing.
that implies that there is some PATH environment variable set -- I wonder why getenv() didn't work?
HTH,
-Chris
···
On 3/10/11 4:28 AM, King wrote:
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chris.Barker@noaa.gov