[GRASS-dev] New attempt to update GRASS for Mac

William Kyngesburye woklist at kyngchaos.com
Sat Jul 29 09:12:27 PDT 2017


Yeah, it doesn't really look at wxpython at runtime, it's (GRASS_WX64BIT) hardwired from compilation.

GRASS_WXBUNDLED is (was? maybe it's been stripped out?) meant to tell the GUI code somewhere that wxpython is bundled, there was a problem where wxpython wouldn't work, maybe it's fixed now.  GRASS_WXBUNDLED is set in custom bundling scripts (not in source).

> On Jul 28, 2017, at 5:24 PM, Michael Barton <Michael.Barton at asu.edu> wrote:
> 
> A bit more information.
> 
> The grass.sh.in script tries to find a pythonw file to use for Python. It checks the setting of GRASS_PYTHON, then it looks in standard places for system Python. 
> 
> The script also seems to set GRASS_PYTHONWX to the value of GRASS_PYTHON after it searches for a useable Python. It says it is trying to find the Python needed by wxPython, but I can see no code that actually checks wxPython. It simply sets GRASS_PYTHONWX to whatever Python it has found, with "pythonw" as a default. 
> 
> And then after all this, it resets GRASS_PYTHON on lines 203 and 204
> 
> GRASS_PYTHON="python"
> export GRASS_PYTHON
> 
> So all of the prior code is pretty much moot as far as the GRASS_PYTHON environmental variable is concerned. Unless there is some program flow that I'm missing something in the program flow, this default should be set only if no other Python is found. 
> 
> There is also a setting in this script:
> 
> GRASS_WXBUNDLED=
> export GRASS_WXBUNDLED
> 
> This seems potentially useful, but does not seem to be used elsewhere.
> 
> Michael
> ____________________
> C. Michael Barton
> Director, Center for Social Dynamics & Complexity 
> Professor of Anthropology, School of Human Evolution & Social Change
> Head, Graduate Faculty in Complex Adaptive Systems Science
> Arizona State University
> 
> voice:  480-965-6262 (SHESC), 480-965-8130/727-9746 (CSDC)
> fax: 480-965-7671 (SHESC),  480-727-0709 (CSDC)
> www: http://www.public.asu.edu/~cmbarton, http://csdc.asu.edu
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>> On Jul 28, 2017, at 4:02 PM, Michael Barton <michael.barton at asu.edu> wrote:
>> 
>> I was able to track this down. 
>> 
>> I was setting GRASS_PYTHON to ../anaconda/bin/python
>> 
>> The grass.sh.in script for Mac OS is set up to only accept "pythonw" for the path to python, not "python".
>> 
>> Once I changed my .profile to include the line:
>> 
>> export GRASS_PYTHON="/Applications/anaconda/bin/python"
>> 
>> Grass launches with this as the default. 
>> 
>> Still trying to figure out how GRASS_PYTHONWX works in this script.
>> 
>> Michael
>> ____________________
>> C. Michael Barton
>> Director, Center for Social Dynamics & Complexity 
>> Professor of Anthropology, School of Human Evolution & Social Change
>> Head, Graduate Faculty in Complex Adaptive Systems Science
>> Arizona State University
>> 
>> voice:  480-965-6262 (SHESC), 480-965-8130/727-9746 (CSDC)
>> fax: 480-965-7671 (SHESC),  480-727-0709 (CSDC)
>> www: http://www.public.asu.edu/~cmbarton, http://csdc.asu.edu
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>>> On Jul 28, 2017, at 1:49 PM, Michael Barton <michael.barton at asu.edu> wrote:
>>> 
>>> ARGGH!
>>> 
>>> Set up and activated virtual environment in conda
>>> Ensured that Anaconda Python is default
>>> Ensured that Anaconda wxPython 4 is default
>>> Compiled GRASS trunk in this environment
>>> Launched the app created and...
>>> 
>>> Launching <wxpython> GUI in the background, please wait...
>>> GRASS 7.3.svn (nc_spm_08_grass7):~ > python
>>> Python 2.7.10 (default, Feb  7 2017, 00:08:15) 
>>> [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)] on darwin
>>> Type "help", "copyright", "credits" or "license" for more information.
>>> >>> import wx
>>> >>> import wxversion
>>> >>> wx.VERSION_STRING
>>> '3.0.2.0'
>>> >>> 
>>> 
>>> Using my system Python and system wxPython
>>> 
>>> Michael
>>> ____________________
>>> C. Michael Barton
>>> Director, Center for Social Dynamics & Complexity 
>>> Professor of Anthropology, School of Human Evolution & Social Change
>>> Head, Graduate Faculty in Complex Adaptive Systems Science
>>> Arizona State University
>>> 
>>> voice:  480-965-6262 (SHESC), 480-965-8130/727-9746 (CSDC)
>>> fax: 480-965-7671 (SHESC),  480-727-0709 (CSDC)
>>> www: http://www.public.asu.edu/~cmbarton, http://csdc.asu.edu
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>>> On Jul 28, 2017, at 12:09 PM, Michael Barton <michael.barton at asu.edu> wrote:
>>>> 
>>>> Previously, we needed to set this path to compile GRASS so that it worked with wxPython wrappers for wxWidgets. I will do a new compile without this argument and see what happens. 
>>>> 
>>>> In any case, I need to be able to make sure that GRASS uses the wxPython that is bundled with it by default to avoid differences in versions and SIP issues. 
>>>> 
>>>> Michael
>>>> ____________________
>>>> C. Michael Barton
>>>> Director, Center for Social Dynamics & Complexity 
>>>> Professor of Anthropology, School of Human Evolution & Social Change
>>>> Head, Graduate Faculty in Complex Adaptive Systems Science
>>>> Arizona State University
>>>> 
>>>> voice:  480-965-6262 (SHESC), 480-965-8130/727-9746 (CSDC)
>>>> fax: 480-965-7671 (SHESC),  480-727-0709 (CSDC)
>>>> www: http://www.public.asu.edu/~cmbarton, http://csdc.asu.edu
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>>> On Jul 28, 2017, at 7:56 AM, Vaclav Petras <wenzeslaus at gmail.com> wrote:
>>>>> 
>>>>> 
>>>>> 
>>>>> On Thu, Jul 27, 2017 at 11:52 PM, Michael Barton <Michael.Barton at asu.edu> wrote:
>>>>> >
>>>>> > The other issue I'm hitting is that the configure argument to enable wxPython, '-with-wxwidgets=' expects a path to a wx_config file. AFAICT, wxPython 4 does not have such a file. And I can't yet find anything that seems to serve the same function. I can put in a path to the folder/directory where the wxPython 4 files live. While this compiles without error, I don't think it is using wxPython 4.
>>>>> >
>>>>> 
>>>>> --with-wxwidgets= is for wxWidgets (C++ library), not wxPython (its Python wrapper), so you don't need to use at all. wxPython must be part of the Python installation you are using.
>>>>> 
>>>> 
>>> 
>> 
> 
> _______________________________________________
> grass-dev mailing list
> grass-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-dev

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

"The beast is actively interested only in now, and, as it is always now and always shall be, there is an eternity of time for the accomplishment of objects."

- the wisdom of Tarzan







More information about the grass-dev mailing list