[GRASS-user] Problems to launch QGIS from GRASS

José wrote:

When I check the echo $PATH from within GRASS
session, this is the message,

GRASS 6.4.1 (spearfish60):~ > echo $PATH
/Applications/GRASS-6.4.app/Contents/MacOS/bin:/Applications/GRASS-6.4.app/Contents/MacOS/scripts:/Users/joseca/Library/GRASS/6.4/Modules/bin:/Library/GRASS/6.4/Modules/bin:/Library/Frameworks/GDAL.framework/unix/bin:/Library/Frameworks/PROJ.framework/Programs:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin

GRASS 6.4.1 (spearfish60):~ > qgis
bash: qgis: command not found

I do not know how to solve it but I am very
grateful to your help.

ah ok, this is a Mac.

first thing to do is to hunt down the qgis executable and get it into one of the $PATH directories.

try like:

ls -l /Applications/QuantumGIS.app/Contents/MacOS/

and look for a qgis file (not directory) with "x" permissions.

once you have that make a symlink into /usr/local/bin

ln -s /Applications/QuantumGIS.app/Contents/MacOS/qgis /usr/local/bin/

you might have to put "sudo" before the symlink to get it to work.

(not sure of exact qgis pathnames, but something
similar to the above)

Hamish

On Dec 11, 2011, at 7:19 PM, Hamish wrote:

José wrote:

When I check the echo $PATH from within GRASS
session, this is the message,

GRASS 6.4.1 (spearfish60):~ > echo $PATH
/Applications/GRASS-6.4.app/Contents/MacOS/bin:/Applications/GRASS-6.4.app/Contents/MacOS/scripts:/Users/joseca/Library/GRASS/6.4/Modules/bin:/Library/GRASS/6.4/Modules/bin:/Library/Frameworks/GDAL.framework/unix/bin:/Library/Frameworks/PROJ.framework/Programs:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin

GRASS 6.4.1 (spearfish60):~ > qgis
bash: qgis: command not found

I do not know how to solve it but I am very
grateful to your help.

ah ok, this is a Mac.

first thing to do is to hunt down the qgis executable and get it into one of the $PATH directories.

try like:

ls -l /Applications/QuantumGIS.app/Contents/MacOS/

and look for a qgis file (not directory) with "x" permissions.

once you have that make a symlink into /usr/local/bin

ln -s /Applications/QuantumGIS.app/Contents/MacOS/qgis /usr/local/bin/

you might have to put "sudo" before the symlink to get it to work.

(not sure of exact qgis pathnames, but something
similar to the above)

I was wondering if you were on OS X...

Note that this symlink method really isn't the proper way to start an *application* on OS X. Running an application from the command line in the standard *nix execute way ignores existing running processes, and will start another if one is already running.

The simplest solution is to just start Qgis the normal way by double-clicking the application.

If you really must start it from within GRASS, then the OS X way is to "open" applications:

open -a QGIS.app

There is no need to symlink QGIS to /usr/local/bin, and no need to know the path to QGIS.app.

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

Theory of the Universe

There is a theory which states that if ever anyone discovers exactly what the universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarrely inexplicable. There is another theory which states that this has already happened.

-Hitchhiker's Guide to the Galaxy 2nd season intro

William wrote:

If you really must start it from within GRASS, then the OS
X way is to "open" applications:

open -a QGIS.app

thanks, added to the wiki:
  http://grass.osgeo.org/wiki/QGIS_GRASS_Cookbook

Hamish