[wxPython-mac] Problems with wx.Process & wx.Execute

Robin Dunn robin at alldunn.com
Wed Mar 12 16:54:16 PDT 2008


John Jackson wrote:
> As usual, Robin nailed it. :)
> 
> The command below works from the command line, which suggested that 
> Robin's hunch was correct.
> 
> In the process demo, I modified the command line to run
> 
> python -c "import sys; sys.stdout.write('%s\n%s' % (sys.version, 
> sys.path))"
> 
> When I run it, I see that I'm running 2.3.5, instead of 2.5.1:
> 
> 2.3.5 (#1, Mar 20 2005, 20:38:20)
> [GCC 3.3 20030304 (Apple Computer, Inc. build 1809)]
> 
> ...and all the elements in the sys.path are from 2.3. So, of course that 
> won't work. That's why Django dies immediately.

The first python found on your default PATH is /usr/bin/python.

> 
> On the Mac command line, "which python" returns
> 
> /Library/Frameworks/Python.framework/Versions/Current/bin/python
> 
> which returns version 2.5.

When MacPython is installed it will fiddle with the PATH such that this 
other directory is first on the PATH so that Python will be found by 
default.  You can still get to the other one if you use the full 
pathname.  It's possible that the PATH change is not being done unless 
you are using a Terminal...  What happens if you do the same test in the 
Process demo but use the full 
/Library/Frameworks/Python.framework/Versions/Current/bin/python path? 
What about the Django script if it is run from a Terminal using the full 
  path to Python?

IIRC you can set the PATH in your ~/.MacOS/environment.plist file to 
make global changes that will be in effect even when a process is not 
launched from a Terminal.  See Google for more details.


-- 
Robin Dunn
Software Craftsman
http://wxPython.org  Java give you jitters?  Relax with wxPython!





More information about the wxpython-mac mailing list