I have Anaconda Python Distribution (Python 3.4.3 :: Anaconda 2.1.0 (64-bit)) installed on Ubuntu 14.04. I would like to create a conda environment for running Grass 7.

To do that I used:

conda create -n grassenv python=2
source activate grassenv
conda install wxpython

When I run grass70 from the terminal it opens up the Grass Shell and gives a message Launching <wxpython> GUI in the background, please wait... but doesn't open the GUI. Is there a way to get Grass & to work inside a conda environment?

  • 1
    Did you ever get this working? I am in the same situation (Mac os 10.9.4). I find the given answer and linked docs confusing, and cannot find "many questions/answers on GIS SE." – J Kelly May 11 '16 at 12:01

What are you trying to do exactly an what is your operating system (Windows, Linux, Mac OS X) ?

  1. If you want to use the Grass shell (grass70), you don't need to create a conda environment if grass70 is in your path.

    enter image description here

  2. If you want to use the Python modules grass.script or grass.pygrass in Anaconda/Python, you have two solutions:

    a) call Anaconda from the Grass shell.

    from grass.script import core as g

    b) call Grass from the Anaconda shell: you must first set environment variables (look at Working with GRASS without starting it explicitly and many questions/answers on GIS SE).

    import grass.script as grass
  • I think it should be clarified that you're calling the python executable packaged with Anaconda. The edit kind of obscured this. Also, with the anaconda python executable not being the one installed with GRASS, how does this work? I attempt to get GRASS to play nicely with the Anaconda distribution every once in a while, or try to install Spyder with pip under the GRASS directory, but nothing ever seems to do the trick. – Lou-gazi Oct 16 '18 at 16:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.