homebrew-osgeo4mac: can't find wxpython after installing from homebrew

I followed the instructions available here for compiling via homebrew and I can start text-based grass, but when I try to launch the GUI, I get the following error:

  File "/usr/local/Cellar/grass7/7.2.0/grass-7.2.0/gui/wxpython/core/globalvar.py", line 69, in CheckForWx
    import wxversion
ImportError: No module named 'wxversion'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/Cellar/grass7/7.2.0/grass-7.2.0/gui/wxpython/core/globalvar.py", line 71, in CheckForWx
    raise ImportError(e)
ImportError: No module named 'wxversion'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/Cellar/grass7/7.2.0/grass-7.2.0/gui/wxpython/gis_set.py", line 31, in <module>
    from core import globalvar
  File "/usr/local/Cellar/grass7/7.2.0/grass-7.2.0/gui/wxpython/core/globalvar.py", line 95, in <module>
    CheckForWx()
  File "/usr/local/Cellar/grass7/7.2.0/grass-7.2.0/gui/wxpython/core/globalvar.py", line 84, in CheckForWx
    print >> sys.stderr, 'ERROR: wxGUI requires wxPython. %s' % str(e)
TypeError: unsupported operand type(s) for >>: 'builtin_function_or_method' and '_io.TextIOWrapper'
ERROR: Error in GUI startup. See messages above (if any) and if necessary, please report this error to the GRASS developers.
On systems with package manager, make sure you have the right GUI package, probably named grass-gui, installed.```

When I tried to import wx in an instance of the frameworks python (the one that I set GRASS_PYTHON to for the homebrew installation) it did not recognize the module either. I reinstalled wxpython via brew, making sure that my anaconda path was not in my PATH environment variable. Now when I start up the frameworks python, it does recognize "import wx" however I still get the same error when trying to start grass. Any thoughts on how to get GRASS to recognize wxpython?

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 1
  • Comments: 28

Most upvoted comments

Got it. I found an old file wxversion.pyc in /usr/local/lib/python2.7/site-packages/ and removed it, Now it works as before.

Awesome!

That warning shouldn’t mean anything, it’s an artifact of the build process.

will do! gimme a few days to get back into this. Can you point me to the most up-to-date instructions for installing from homebrew? Is the link I originally posted the best place to find something like this?