grass icon indicating copy to clipboard operation
grass copied to clipboard

[Bug] Error when launching GRASS GIS 8.0.0-RC1-1 on Windows

Open isaacnewtonfx opened this issue 3 years ago • 33 comments

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:

  1. Download GRASS 8.0.0-RC1-1 from grass gis website
  2. Install the program on windows 10
  3. After installation, launch the program
  4. See error

Expected behavior It has to open the GRASS GIS 8.0.0 graphical user interface without an error

Screenshots image

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.

isaacnewtonfx avatar Jan 17 '22 09:01 isaacnewtonfx

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).

nilason avatar Jan 17 '22 09:01 nilason

That is great @nilason. I would try the RC2 when the windows executable is ready and give feedback on the issue.

isaacnewtonfx avatar Jan 17 '22 09:01 isaacnewtonfx

https://grass.osgeo.org/grass80/binary/mswindows/native/WinGRASS-8.0.0RC2-1-Setup.exe

nilason avatar Jan 17 '22 20:01 nilason

Wow the executable is now available...let me test it at work today and give feedback.

isaacnewtonfx avatar Jan 18 '22 06:01 isaacnewtonfx

I have downloaded the RC2 setup. It runs into the same error.

image

image

isaacnewtonfx avatar Jan 18 '22 08:01 isaacnewtonfx

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

petrasovaa avatar Jan 18 '22 15:01 petrasovaa

No, everything is set to English.

image

image

isaacnewtonfx avatar Jan 18 '22 16:01 isaacnewtonfx

What about the Regional format? Could you change that and try again? Not sure if restart is required.

petrasovaa avatar Jan 18 '22 16:01 petrasovaa

Ok, I will try that and get back.

isaacnewtonfx avatar Jan 18 '22 16:01 isaacnewtonfx

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.

nilason avatar Jan 18 '22 17:01 nilason

The changes to the locale settings on my Windows 10 enterprise did not make any difference.

isaacnewtonfx avatar Jan 18 '22 17:01 isaacnewtonfx

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...

nilason avatar Jan 18 '22 18:01 nilason

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

neteler avatar Jan 18 '22 18:01 neteler

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.

petrasovaa avatar Jan 18 '22 19:01 petrasovaa

Are there more Python versions in %PATH% ?

hellik avatar Jan 18 '22 20:01 hellik

https://github.com/wxWidgets/wxWidgets/blob/9c0a8be1dc32063d91ed1901fd5fcd54f4f955a1/src/common/intl.cpp#L1699

nilason avatar Jan 18 '22 20:01 nilason

Triggering code in wxWidgets has changed in master: https://github.com/wxWidgets/wxWidgets/commit/c9e2143a7a97ef82bcc20e8c6956663523a62adf commit message may give some clue.

nilason avatar Jan 18 '22 20:01 nilason

it seems to be a Windows CRT related issue.

see https://github.com/OSGeo/grass/discussions/2064

hellik avatar Jan 18 '22 21:01 hellik

  1. Regarding the python paths available on Environment Variables %PATH%, I have ArcGIS 10.8 and ArcGIS Pro.
  2. ArcGIS 10.8 is running on Python 2.7 and ArcGIS Pro is running on python 3.7.10.
  3. The ArcGIS 10.8 Python 2.7 is what gets recognized when called in Windows Command Prompt by default

image

image

isaacnewtonfx avatar Jan 19 '22 05:01 isaacnewtonfx

Could you rename temporarily step by by these Arcgis pythons and try to start winGRASS?

hellik avatar Jan 19 '22 06:01 hellik

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.

isaacnewtonfx avatar Jan 19 '22 07:01 isaacnewtonfx

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 laptop specs

The Locale information on this windows 10 pro image image

Below is the GRASS 8.0.0 interface image

isaacnewtonfx avatar Jan 19 '22 13:01 isaacnewtonfx

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?

hellik avatar Jan 19 '22 20:01 hellik

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.

hellik avatar Jan 19 '22 20:01 hellik

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...

isaacnewtonfx avatar Jan 19 '22 20:01 isaacnewtonfx

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.

changes to wxgui

Details of the Windows 10 Pro Desktop desktop on which the changes were made is as shown below. details

isaacnewtonfx avatar Jan 20 '22 10:01 isaacnewtonfx

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())

petrasovaa avatar Jan 20 '22 14:01 petrasovaa

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)

Capture1

Capture2

isaacnewtonfx avatar Jan 21 '22 07:01 isaacnewtonfx

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.

petrasovaa avatar Jan 24 '22 03:01 petrasovaa

Well noted, I would wait on a new version to test it and revert on how it goes.

isaacnewtonfx avatar Jan 24 '22 06:01 isaacnewtonfx

Hello...has anyone been able to fix wxlocale error upon starting grass gis:

image

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

nCVJTK avatar Feb 03 '22 22:02 nCVJTK