OSGeo / homebrew-osgeo4mac

Mac homebrew tap for maintaining a stable work environment for the OSGeo.org geospatial toolset
https://git.io/fhh3X
BSD 3-Clause "New" or "Revised" License
364 stars 111 forks source link

7.8 Homebrew install won't launch #1377

Closed georgesnyder closed 4 years ago

georgesnyder commented 4 years ago

I installed GRASS v7.8.2 following the instructions on https://grasswiki.osgeo.org/wiki/Compiling_on_MacOSX_using_homebrew

Describe the bug After attempting to launch the gui grass78 --gui I get the following error:

bash-3.2$ grass78 --gui Starting GRASS GIS... Traceback (most recent call last): File "/usr/local/Cellar/osgeo-grass/7.8.2_5/grass78/gui/wxpython/gis_set.py", line 1148, in OnInit StartUp = GRASSStartup() File "/usr/local/Cellar/osgeo-grass/7.8.2_5/grass78/gui/wxpython/gis_set.py", line 224, in __init__ self._do_layout() File "/usr/local/Cellar/osgeo-grass/7.8.2_5/grass78/gui/wxpython/gis_set.py", line 399, in _do_layout description=self.llocation) File "/usr/local/Cellar/osgeo-grass/7.8.2_5/grass78/gui/wxpython/gis_set.py", line 376, in layout_list_box border=1) wx._core.wxAssertionError: C++ assertion "!(flags & wxALIGN_CENTRE_HORIZONTAL)" failed at /Users/robind/projects/bb2/dist-osx-py37/build/ext/wxWidgets/src/common/sizer.cpp(2106) in DoInsert(): Horizontal alignment flags are ignored in horizontal sizers OnInit returned false, exiting... 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. To run GRASS GIS in text mode use the --text flag. Use '--help' for further options grass78 --help See also: https://grass.osgeo.org/grass78/manuals/helptext.html Exiting...

brew update and doctor turn up no issues. I have also attempted to simply install the binaries but those are being buggy as well (v7.8, 7.6, and 7.4 all refuse to open on my computer).

I have installed and used GRASS on my computer before but this is the first time I've encountered any installation issues. Currently running macOS Catalina 10.15.3

Please help! And happy to provide any information.

alazarolop commented 4 years ago

Hi @georgesnyder , it's due to a dependency issue we've found when rebuilding matplotlib for latest upgrades in both homebrew core and the tap. Some support is needed to fix it, but we are working on it.

alazarolop commented 4 years ago

@georgesnyder can you try to install the latest version?

georgesnyder commented 4 years ago

@alazarolop thanks so much for the help. I just attempted to reinstall and received the same error code (now just with v7.8.3). Let me know if I can provide you with any more information.

alazarolop commented 4 years ago

Have you upgrade or remove and reinstall its dependencies osgeo-sip, osgeo-six and osgep-matplotlib too? In order to use the gui, one usually need to install wxpython first by pip3 install wxpython?

georgesnyder commented 4 years ago

Reinstalled all the dependencies and still same error. I also had wxpython installed beforehand. Not sure if it matters but when reinstalling via brew reinstall osgeo-grass I get the warning:

==> Pouring osgeo-grass-7.8.3_5.catalina.bottle.tar.gz Warning: osgeo/osgeo4mac/osgeo-grass dependency gcc was built with a different C++ standard library (libstdc++ from clang). This may cause problems at runtime. ==> Caveats

If it is the case that you can change the shebang at the beginning of the script to enforce Python 3 usage.

!/usr/bin/env python

Should be changed into

!/usr/bin/env python3

alazarolop commented 4 years ago

AFAIK it shouldn't. With this new version you need to install wxpython using pip3 as it uses Python 3, have you confirmed it's installed this way?

jeanmico commented 4 years ago

I am receiving the same error message as in the first post. I did not have wxpython installed before; I used pip3 to install it.

georgesnyder commented 4 years ago

@alazarolop yup I installed wxpython with pip3. I just tried a fresh install of homebrew, grass, and python etc. and still getting the same error :/

let me know if I can provide you with more information, thanks for your help.

alazarolop commented 4 years ago

@jeanmico did it work after that?

@georgesnyder So you also reinstall wxpython after that, right? As long as you have it installed you shouldn't see this issue. Have you tried to use GRASS GIS from command line (without the --gui flag)? If you are in a hurry, you could check the Mac OS X section of GRASS GIS webpage.

jeanmico commented 4 years ago

@alazarolop no, I haven't been able to launch GRASS. There was an old install on my machine, but I had never used it (and it was not installed via homebrew), so I unlinked the old dependencies (proj, netcdf, etc.) and then ran the commands from the wiki page:

pip3 install wxpython brew tap osgeo/osgeo4mac brew install osgeo-grass

and then launching via

grass78 --gui which produces the following error message.

~ $ grass78 --gui Starting GRASS GIS... Traceback (most recent call last): File "/usr/local/Cellar/osgeo-grass/7.8.3_5/grass78/gui/wxpython/gis_set.py", line 1146, in OnInit StartUp = GRASSStartup() File "/usr/local/Cellar/osgeo-grass/7.8.3_5/grass78/gui/wxpython/gis_set.py", line 224, in __init__ self._do_layout() File "/usr/local/Cellar/osgeo-grass/7.8.3_5/grass78/gui/wxpython/gis_set.py", line 399, in _do_layout description=self.llocation) File "/usr/local/Cellar/osgeo-grass/7.8.3_5/grass78/gui/wxpython/gis_set.py", line 376, in layout_list_box border=1) wx._core.wxAssertionError: C++ assertion "!(flags & wxALIGN_CENTRE_HORIZONTAL)" failed at /Users/robind/projects/bb2/dist-osx-py37/build/ext/wxWidgets/src/common/sizer.cpp(2106) in DoInsert(): Horizontal alignment flags are ignored in horizontal sizers OnInit returned false, exiting... 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. To run GRASS GIS in text mode use the --text flag. Use '--help' for further options grass78 --help See also: https://grass.osgeo.org/grass78/manuals/helptext.html Exiting...

georgesnyder commented 4 years ago

@alazarolop Yep installed wxpython with pip3. Launching with grass78 without the -gui flag gives the same error.

alazarolop commented 4 years ago

There are other issues around GRASS from the tap too, so as for now it would be probably safer to check the all-in-one solution from GRASS webpage https://github.com/OSGeo/homebrew-osgeo4mac/issues/1377#issuecomment-627167275 I don't have any experience with them though.

georgesnyder commented 4 years ago

For the sake of anyone else encountering this issue... I ended up doing a clean install of MacOS Catalina and downloaded the latest stable binary. I now have a functioning copy of GRASS.

I also experimented with installing via homebrew after the clean install and had the same issue as before, just FYI. Thanks again @alazarolop for working to get the problem resolved.

alazarolop commented 4 years ago

@georgesnyder Thank you for your words. I'm glad you were able to get it working, although it couldn't be via HomeBrew.

stale[bot] commented 4 years ago

This issue or pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want to keep the issue open, please comment or update the info here. Thank you for your contributions.

LakeRainSound commented 4 years ago

Hi. Is this the same error? I can't start up on grass78. I would like to use grass, is there another way to handle this?

❯ grass78
Starting GRASS GIS...
Traceback (most recent call last):
  File "/usr/local/Cellar/osgeo-grass/7.8.3_7/grass78/gui/wxpython/gis_set.py", line 1146, in OnInit
    StartUp = GRASSStartup()
  File "/usr/local/Cellar/osgeo-grass/7.8.3_7/grass78/gui/wxpython/gis_set.py", line 224, in __init__
    self._do_layout()
  File "/usr/local/Cellar/osgeo-grass/7.8.3_7/grass78/gui/wxpython/gis_set.py", line 399, in _do_layout
    description=self.llocation)
  File "/usr/local/Cellar/osgeo-grass/7.8.3_7/grass78/gui/wxpython/gis_set.py", line 376, in layout_list_box
    border=1)
wx._core.wxAssertionError: C++ assertion "!(flags & wxALIGN_CENTRE_HORIZONTAL)" failed at /Users/robind/projects/bb2/dist-osx-py37/build/ext/wxWidgets/src/common/sizer.cpp(2106) in DoInsert(): Horizontal alignment flags are ignored in horizontal sizers
OnInit returned false, exiting...
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.
To run GRASS GIS in text mode use the --text flag.
Use '--help' for further options
     grass78 --help
See also: https://grass.osgeo.org/grass78/manuals/helptext.html
Exiting...

so, I reinstall osgeo-grass

❯ brew reinstall osgeo-grass
==> Downloading https://bottle.download.osgeo.org/osgeo-grass-7.8.3_7.catalina.bottle.tar.gz
Already downloaded: /Users/restartsugar/Library/Caches/Homebrew/downloads/1946f073bd6a3f970d95df5323740499ef5f2b5fe052cf1b74f2263f337bff01--osgeo-grass-7.8.3_7.catalina.bottle.tar.gz
==> Reinstalling osgeo/osgeo4mac/osgeo-grass
==> Pouring osgeo-grass-7.8.3_7.catalina.bottle.tar.gz
Warning: osgeo/osgeo4mac/osgeo-grass dependency gcc was built with a different C++ standard
library (libstdc++ from clang). This may cause problems at runtime.
==> Caveats

If it is the case that you can change the shebang at the beginning of
the script to enforce Python 3 usage.

  #!/usr/bin/env python

Should be changed into

  #!/usr/bin/env python3

==> Summary
🍺  /usr/local/Cellar/osgeo-grass/7.8.3_7: 8,292 files, 94.3MB

Is it because of C++?

alazarolop commented 4 years ago

Hi @LakeRainSound , that shouldn't be the problem, it's a common warning. Have you tried suggested fixes in this thread?

LakeRainSound commented 4 years ago

Yes, but can’t work. So now I’m trying to use osgeo-grass by using Docker.

alazarolop commented 4 years ago

I'm sorry that didn't work, what about the all-in-one installer https://github.com/OSGeo/homebrew-osgeo4mac/issues/1377#issuecomment-627167275 ? I hope you are able to fix it with the Docker image.

nilason commented 4 years ago

By the looks of it this is caused by a too new wxPython for GRASS 7.8.3, probably 4.1.0. Better use 4.0.7.post2.

See e.g. https://github.com/OSGeo/grass/pull/570.

stale[bot] commented 4 years ago

This issue or pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want to keep the issue open, please comment or update the info here. Thank you for your contributions.

stale[bot] commented 4 years ago

This issue or pull request has been automatically closed because it has not had recent activity. Thank you for your contributions.