[Qgis-user] GRASS dependency problem on OS X

William Kyngesburye woklist at kyngchaos.com
Wed Mar 11 16:44:13 PDT 2015


Ah, this is getting somewhere now.  It should be set automatically by the system.  Maybe there is something interfering with this in this user.  When you start a Terminal, you get a bunch of environment settings which can be customized in your .bash_profile, but applications don't get initialized the same way and the .bash_profile has no effect on them.

You can check what QGIS gets in preferences-system under Current environment variables, the non-bold ones are automatic.  SHELL should be in there unmodified, among many others.

QGIS may be pulling in some environment initialization on its own to make up for this, but there is an equivalent customization method for applications: ~/.MacOSX/environment.plist.  Some unix crossover stuff (like the package managers, fink, macports, ...) may alter this.  See if you have this file and if it has a SHELL setting.

It's sometimes suggested as a workaround for missing environment stuff in applications (even for QGIS for some past problems), but I don't recommend it - not user-friendly at all, and you can forget about it and have problems like this.

On Mar 11, 2015, at 2:36 PM, Howard Frederick <simbamangu at gmail.com> wrote:

> I’m running as admin - but testing with a guest user and different admin user GRASS works fine.
> 
> Experimenting with deleting .qgis2/ then re-running QGIS and testing:
> 	• After attempting to run a GRASS tool, grass_batch_job.sh is created in ../processing
> 	• A random folder is created, but no output.
> 
> Now, looking at processing.log in the processing folder, there is some output:
> 
> GRASS execution console output|Cleaning up temporary files ...|Starting GRASS ...|ERROR: The SHELL variable is not set|Cleaning up temporary files ...|Starting GRASS ...|ERROR: The SHELL variable is not set
> 
> Not sure what SHELL variable means in this case? 
> 
>> On 11 Mar 2015, at 17:40, William Kyngesburye <woklist at kyngchaos.com> wrote:
>> 
>> Well, wrong permissions could affect only some users, but if they look right, no.
>> 
>> You've deleted every preference I know of.
>> 
>> What OS X version?
>> 
>> Are you using an admin user?  What about the new user that works?  (it shouldn't matter)
>> 
>> You can dig deeper to try to figure out HOW it's failing (unfortunately, Processing doesn't give any direct log output of the provider tests, and the console log will only show system-level errors like library loading problems or crashes)... For the GRASS provider test, it simply tries to run a quick algorithm: v.voronoi.  Running an algorithm sets up a shell script in .qgis2/processing, obvious name by provider.  Output goes to the user's temp folder, which you can find under Processing-Options-General-Output.
>> 
>> So, first check, is the grass_batch_job.sh created in .qgis2/processing?  Is there a shapefile in a randomly-named folder in the output folder (there shouldn't be if it's failing, but the folder will be there)?
>> 
>> On Mar 10, 2015, at 11:19 PM, Howard Frederick <simbamangu at gmail.com> wrote:
>> 
>>> The permissions are correct - and don't forget the other part of this mystery, that if I use QGIS with a different user, GRASS works just fine! 
>>> 
>>> This implies there's something wrong with settings or prefs for my user.
>>> 
>>> I've deleted/reinstalled QGIS, removed ~/.qgis2, removed the preferences .plist - all I can think is that there must be some other configuration file I'm missing?
>>> 
>>> On 11 March 2015 at 01:13, William Kyngesburye <woklist at kyngchaos.com> wrote:
>>> One things that sometimes trips GRASS - executable permissions.  The installer is supposed to make sure GRASS is executable, because there were problems with that in the past.  Easy brute force method - delete QGIS and reinstall.
>>> 
>>> But it would be good to know if that is still a problem for some odd reason.  You can check from a terminal with:
>>> 
>>> ls -l /Applications/QGIS.app/Contents/MacOS/grass/grass.sh
>>> 
>>> You'll see a line starting with a bunch of letters and hyphens, it should look like:
>>> 
>>> -rwxr-xr-x
>>> 
>>> If one "x" is missing, especially the last one, this could cause problems for one user but not another.
>>> 
>>> On Mar 10, 2015, at 2:38 PM, Howard Frederick <simbamangu at gmail.com> wrote:
>>> 
>>>> Processing algorithms for other providers work - tested R and SAGA at least.
>>>> 
>>>> The dependency error is thrown the moment I try to open any GRASS tool, and the tool dialog never appears - so there is no opportunity to even try to run any GRASS algorithm!
>>>> 
>>>> Error dialog:
>>>> Missing dependency. This algorithm cannot be run :-(
>>>> This algorithm requires GRASS to be run. Unfortunately, it seems that GRASS is not installed in your system, or it is not correctly configured to be used from QGIS
>>>> Click here to know more about how to install and configure GRASS to be used with QGIS
>>>> 
>>>> On 10 March 2015 at 17:17, William Kyngesburye <woklist at kyngchaos.com> wrote:
>>>> I mean the Processing log for the algorithm.  Turn on that Processing option for keeping algorithm windows open, then you should hopefully see the details of the error in the algorithm window.  You might not since I'm not sure the dependency check shows up there.
>>>> 
>>>> Do Processing algorithms from other providers run?
>>>> 
>>>> One thing I found while checking SAGA is that I needed to delete the path for its configuration so it could automatically find the internal path again (even though the stored path was correct).  Though you get the same effect by trashing ~/.qgis2.
>>>> 
>>>> On Mar 10, 2015, at 8:56 AM, Howard Frederick <simbamangu at gmail.com> wrote:
>>>> 
>>>>> It allows GRASS to be activated in the Processing options, but gives the dependency error if I actually try to run any of the tools.
>>>>> 
>>>>> The OS X console logs this when this failure happens:
>>>>> 
>>>>> 10/03/15 16:42:05.779 QGIS[3835]: modalSession has been exited prematurely - check for a reentrant call to endModalSession:
>>>>> 
>>>>> 
>>>>> 
>>>>> On 10 March 2015 at 16:25, William Kyngesburye <woklist at kyngchaos.com> wrote:
>>>>> Does it allow you to turn on GRASS in Processing?  If so, you can see what the actual error is in the algorithm output when you try to run one if you turn on the Processing option to leave windows open when done.
>>>>> 
>>>>> On Mar 9, 2015, at 11:47 PM, Howard Frederick <simbamangu at gmail.com> wrote:
>>>>> 
>>>>>> Frustrating and inconsistent problem with GRASS dependency in QGIS 2.8 (and 2.6 before upgrading).
>>>>>> 
>>>>>> I get the usual “unmet dependency” error when trying to run any GRASS tool - but the Options link correctly to the location of the grass folder inside QGIS.app.
>>>>>> 
>>>>>> I have done a clean install, removing the preferences (org.qgis.QGIS2.plist), the .qgis2 folder and anything else I could find, but the problem persists.
>>>>>> 
>>>>>> The puzzle: on the same machine, if I create a new user and log in, GRASS tools run just fine in QGIS, with no modifications of the Processing configuration! Seems there is some configuration file that is messing with things - or possibly a path setting?
>>>>>> 
>>>>>> Any suggestions as to what I could look for?
>> 
>> -----
>> William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
>> http://www.kyngchaos.com/
>> 
>> "Those people who most want to rule people are, ipso-facto, those least suited to do it."
>> 
>> - A rule of the universe, from the HitchHiker's Guide to the Galaxy
> 

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

"Time is an illusion - lunchtime doubly so."

- Ford Prefect





More information about the Qgis-user mailing list