grass
grass copied to clipboard
[Bug] Error when launching GRASS GIS 8.0.0-RC1-1 on Windows
Describe the bug After installing GRASS GIS 8.0.0-RC1-1, it failed to launch on my laptop with a strange error message.
To Reproduce Steps to reproduce the behavior:
- Download GRASS 8.0.0-RC1-1 from grass gis website
- Install the program on windows 10
- After installation, launch the program
- See error
Expected behavior It has to open the GRASS GIS 8.0.0 graphical user interface without an error
Screenshots

System description (please complete the following information):
- Operating System: Windows 10 Entreprise version 1909
- GRASS GIS version 8.0.0 RC1-1
Additional context I installed it using administrator rights and launched it using administrator rights. The Windows user is also an Administrator.
This has been addressed for RC2 (https://github.com/OSGeo/grass/commit/04af08cd45e48f4b7016366bc29826bd40317dce), remains to see if also solved (see https://lists.osgeo.org/pipermail/grass-dev/2022-January/095519.html).
That is great @nilason. I would try the RC2 when the windows executable is ready and give feedback on the issue.
https://grass.osgeo.org/grass80/binary/mswindows/native/WinGRASS-8.0.0RC2-1-Setup.exe
Wow the executable is now available...let me test it at work today and give feedback.
I have downloaded the RC2 setup. It runs into the same error.


Do you have non-english locale? See also https://github.com/wxWidgets/Phoenix/issues/1751, it's a mess, likely related to Python 3.8
No, everything is set to English.


What about the Regional format? Could you change that and try again? Not sure if restart is required.
Ok, I will try that and get back.
This has been addressed for RC2 (04af08c), remains to see if also solved (see https://lists.osgeo.org/pipermail/grass-dev/2022-January/095519.html).
Looking closer at the screenshot, I realise my previously linked commit and mail list post are not related to this reported issue. I just successfully installed and started RC2 on a Windows 10 Pro machine.
The changes to the locale settings on my Windows 10 enterprise did not make any difference.
For better overview, this is the error message in text:
C: \Users\Newton>Traceback (most recent call last):
File "C: \Program Files\GRASS GIS 8.0\gui\wxpython\wxgui.py", line 72, in OnInit
introImage = wx.Image (introImagePath, wx.BITMAP_TYPE_PNG)
wx-_core.wxAssertionError: (++ assertion "stremp(setlocale(0,0), "C") == 0" failed at
D:\srclosge04w|src(wxwidgets\wxwidgets-3.1.5-Odf1d81acd6f1be8624022f8eecb51679008ca40\src\common\intl.cpp(1694)
in wxLocale::GetInfo(): You probably called setlocale() directly instead of using wxLocale and now there is
a mismatch between C/C++ and Windows locale.
Things are going to break, please only change locale by creating wxLocale objects to avoid this!
OnInit returned false, exiting...
Could something like this help (wild guess by searching around):
- "run
self.locale = wx.Locale(wx.LANGUAGE_ENGLISH)as part of ..." (source)
or, modified:
locale.setlocale(locale.LC_ALL, wx.GetLocale().Name)
for full code, see https://github.com/CellProfiler/CellProfiler/commit/8525f654af683150d9123fd99d8eccdb531eaf0c
Possibly, not quite sure what the implications of that are. This is the project's latest code: https://github.com/CellProfiler/CellProfiler/blob/master/cellprofiler/gui/app.py#L60
Obviously this needs to be well tested.
Are there more Python versions in %PATH% ?
https://github.com/wxWidgets/wxWidgets/blob/9c0a8be1dc32063d91ed1901fd5fcd54f4f955a1/src/common/intl.cpp#L1699
Triggering code in wxWidgets has changed in master: https://github.com/wxWidgets/wxWidgets/commit/c9e2143a7a97ef82bcc20e8c6956663523a62adf commit message may give some clue.
it seems to be a Windows CRT related issue.
see https://github.com/OSGeo/grass/discussions/2064
- Regarding the python paths available on Environment Variables %PATH%, I have ArcGIS 10.8 and ArcGIS Pro.
- ArcGIS 10.8 is running on Python 2.7 and ArcGIS Pro is running on python 3.7.10.
- The ArcGIS 10.8 Python 2.7 is what gets recognized when called in Windows Command Prompt by default


Could you rename temporarily step by by these Arcgis pythons and try to start winGRASS?
Could you rename temporarily step by by these Arcgis pythons and try to start winGRASS?
Just tried that, but did not make a difference. I want to try Grass 8.0.0 RC2 on a machine that has a fresh Windows installation to see how it works there and I would give the feedback.
GASS 8.0.0 RC2 is running without a problem on a freshly installed Windows 10 Pro. Could it be a Windows 10 Enterprise specific problem?
See below, specs of the laptop and freshly installed Windows 10 Pro

The Locale information on this windows 10 pro

Below is the GRASS 8.0.0 interface

Could you rename temporarily step by by these Arcgis pythons and try to start winGRASS?
Just tried that, but did not make a difference.
have you installed the MS runtimes provided by the winGRASS installer?
Could it be a Windows 10 Enterprise specific problem?
it seems so. it may be some kind of a CRT issue, as Microsoft is moving away from MSCRT to forced use of UCRT.
it seems so. it may be some kind of a CRT issue, as Microsoft is moving away from MSCRT to forced use of UCRT.
Yes, I do check the box to install the CRT that comes with the grass installer. I reinstalled it but still the same old problem. I also turned off completely the Windows Security app but still old problem. Quite a funny thing going on somewhere...
Could something like this help (wild guess by searching around):
- "run
self.locale = wx.Locale(wx.LANGUAGE_ENGLISH)as part of ..." (source)
@neteler
I tried Grass 8.0.0 RC2 On another desktop running Windows 10 Pro version 21H1 and the same problem occurred.
I edited the file at the "Program Files\GRASS GIS 8.0\gui\wxpython\wxgui.py" as shown below and the error went away. See below changes. However, I tried these changes on Windows 10 Enterprise and it did not solve the problem.
Details of the Windows 10 Pro Desktop desktop on which the changes were made is as shown below.
You can try the code I linked:
import locale
# Need to startup wx in English, otherwise C++ can't load images.
self.locale = wx.Locale(wx.LANGUAGE_ENGLISH)
# Ensure Python uses the same locale as wx
locale.setlocale(locale.LC_ALL, self.locale.GetName())
import locale # Need to startup wx in English, otherwise C++ can't load images. self.locale = wx.Locale(wx.LANGUAGE_ENGLISH) # Ensure Python uses the same locale as wx locale.setlocale(locale.LC_ALL, self.locale.GetName())
Just tried it, the locale error did not come up. But now a different error (see below)
I merged a fix, the GUI should at least start now, but the problem with loading libraries would be still there (not sure why that happens), so some functionality wouldn't work. You would need to download a new version https://wingrass.fsv.cvut.cz/grass80/ to test.
Well noted, I would wait on a new version to test it and revert on how it goes.
Hello...has anyone been able to fix wxlocale error upon starting grass gis:

The same error i get with grass 7.8.6 and new 8.0.0...my pc runs on win 10 pro....thx!