Opened 2 years ago

Closed 6 weeks ago

#3656 closed defect (fixed)

cannot launch GRASS GIS 7.4.1 gis_set error

Reported by: cgarzon Owned by: grass-dev@…
Priority: normal Milestone: 7.4.5
Component: Startup Version: 7.4.0
Keywords: gis_set error, python Cc:
CPU: Unspecified Platform: MacOSX

Description (last modified by neteler)

I have the following problem: When I try to open GRASS GIS 7.4.1 (or 7.4.0) I get "Gis_set error 'es_CO' cannot be set" and the program immediately shuts down. I have a Mac OS High Sierra 10.13.6. This is the error message I get:

Rebuilding Addon HTML manual pages index...
Rebuilding Addon menu...
Default locale not found, using UTF-8
WARNING: Default locale settings are missing. GRASS running with C locale.
Cleaning up temporary files...
access: No such file or directory
ERROR: LOCALIZACIÓN </Users/Gabriela/Documents/Los
       Andes/Biología/grassdata/nc_spm_08_grass7> no disponible
Starting GRASS GIS...
Traceback (most recent call last):
  File "/Applications/GRASS-7.4.1.app/Contents/Resources/gui/wxpython/gis_set.py", line 1236, in OnInit
    StartUp = GRASSStartup()
  File "/Applications/GRASS-7.4.1.app/Contents/Resources/gui/wxpython/gis_set.py", line 233, in __init__
    self._set_properties(grassVersion, grassRevisionStr)
  File "/Applications/GRASS-7.4.1.app/Contents/Resources/gui/wxpython/gis_set.py", line 286, in _set_properties
    self.OnSetDatabase(None)
  File "/Applications/GRASS-7.4.1.app/Contents/Resources/gui/wxpython/gis_set.py", line 985, in OnSetDatabase
    self._showError(_("Path '%s' doesn't exist.") % gisdbase)
  File "/Applications/GRASS-7.4.1.app/Contents/Resources/gui/wxpython/gis_set.py", line 511, in _showError
    self.lmessage.SetLabel(_("Error: {text}").format(text=text))
UnicodeEncodeError: 'ascii' codec can't encode character u'\xed' in position 48: ordinal not in range(128)
OnInit returned false, exiting...

Carol.

Change History (18)

comment:1 Changed 2 years ago by neteler

Component: DefaultStartup
Description: modified (diff)
Keywords: python added
Milestone: 7.4.2

comment:2 Changed 2 years ago by neteler

Does the path /Users/Gabriela/Documents/ .... /nc_spm_08_grass7 contain a white space? From the error message above that's not clear (not your fault!).

comment:3 Changed 2 years ago by cgarzon

Yes, it does. It is

/Users/Gabriela/Documents/Los? Andes/Biología?/grassdata/nc_spm_08_grass7

it shouldn't have?

Thanks!

comment:4 in reply to:  3 Changed 2 years ago by neteler

Replying to cgarzon:

Yes, it does. It is

/Users/Gabriela/Documents/Los? Andes/Biología?/grassdata/nc_spm_08_grass7

it shouldn't have?

It is not recommended (should work yes but who knows...).

But more likely the "í" in "Biología" is causing troubles in 7.4.1. Could you please change that word to one without "í", try again and report? Thanks

comment:5 Changed 2 years ago by cgarzon

The folders name was changed from Biología to biologia and Los Andes to losandes with no spaces. We installed a previous version of GRASS 7.2.2 and there is still an error:

/Applications/GRASS-7.2.2.app/Contents/MacOS/Grass.sh MacBook?-Pro-de-Gabriela-2:~ Gabriela$ /Applications/GRASS-7.2.2.app/Contents/MacOS/Grass.sh Rebuilding Addon HTML manual pages index... Rebuilding Addon menu... Traceback (most recent call last):

File "/Applications/GRASS-7.2.2.app/Contents/Resources/bin/grass72", line 54, in <module>

ENCODING = locale.getdefaultlocale()[1]

File "/Applications/GRASS-7.2.2.app/Contents/Resources/lib/python2.7/locale.py", line 545, in getdefaultlocale

return _parse_localename(localename)

File "/Applications/GRASS-7.2.2.app/Contents/Resources/lib/python2.7/locale.py", line 477, in _parse_localename

raise ValueError?, 'unknown locale: %s' % localename

ValueError?: unknown locale: UTF-8

comment:6 Changed 2 years ago by cgarzon

also we reinstalled the GRASS GIS 7.4.1 and we get the same error:

", line 233, in init

self._set_properties(grassVersion, grassRevisionStr)

File "/Applications/GRASS-7.4.1.app/Contents/Resources/gui/wxpython/gis_set.py", line 286, in _set_properties

self.OnSetDatabase?(None)

File "/Applications/GRASS-7.4.1.app/Contents/Resources/gui/wxpython/gis_set.py", line 985, in OnSetDatabase?

self._showError(_("Path '%s' doesn't exist.") % gisdbase)

File "/Applications/GRASS-7.4.1.app/Contents/Resources/gui/wxpython/gis_set.py", line 511, in _showError

self.lmessage.SetLabel?(_("Error: {text}").format(text=text))

UnicodeEncodeError?: 'ascii' codec can't encode character u'\xed' in position 48: ordinal not in range(128)

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

grass74 --help

See also: https://grass.osgeo.org/grass74/manuals/helptext.html

Exiting...

MacBook?-Pro-de-Gabriela-2:~ Gabriela$

comment:7 in reply to:  5 ; Changed 2 years ago by marisn

Replying to cgarzon:

The folders name was changed from Biología to biologia and Los Andes to losandes with no spaces. We installed a previous version of GRASS 7.2.2 and there is still an error:

/Applications/GRASS-7.2.2.app/Contents/MacOS/Grass.sh MacBook?-Pro-de-Gabriela-2:~ Gabriela$ /Applications/GRASS-7.2.2.app/Contents/MacOS/Grass.sh Rebuilding Addon HTML manual pages index... Rebuilding Addon menu... Traceback (most recent call last):

File "/Applications/GRASS-7.2.2.app/Contents/Resources/bin/grass72", line 54, in <module>

ENCODING = locale.getdefaultlocale()[1]

File "/Applications/GRASS-7.2.2.app/Contents/Resources/lib/python2.7/locale.py", line 545, in getdefaultlocale

return _parse_localename(localename)

File "/Applications/GRASS-7.2.2.app/Contents/Resources/lib/python2.7/locale.py", line 477, in _parse_localename

raise ValueError?, 'unknown locale: %s' % localename

ValueError?: unknown locale: UTF-8

This error comes from Python (https://bugs.python.org/issue18378). Fix your locale settings and it will be gone. Append following lines to your ~/.bash_profile:

export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8

comment:8 in reply to:  7 Changed 2 years ago by neteler

Replying to marisn:

Replying to cgarzon: This error comes from Python (https://bugs.python.org/issue18378). Fix your locale settings and it will be gone. Append following lines to your ~/.bash_profile:

export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8

cgarzon: does this work for you?

comment:9 Changed 2 years ago by cmbarton

This bug is reported for Python 3.x. So I wonder if it is or is not a problem for Python 2.7.

The binaries I've posted are all made with 2.7. I do not have LC_ALL or LANG set in my .profile and do not have this problem, even though my system is set to English. Some years ago colleagues encounter problems with systems set to Spanish or other languages. I do not know if this is still an issue or not.

comment:10 Changed 2 years ago by cgarzon

We edited ~/.bash_profile and ~/.profile, and uninstalled phyton 3.6. Now GRASS is using python 2.7 and the error persists. We ran locale and the settings are changed:

android-db3310249737a4f2:~ Gabriela$ locale

LANG="en_US.UTF-8"

LC_COLLATE="en_US.UTF-8"

LC_CTYPE="en_US.UTF-8"

LC_MESSAGES="en_US.UTF-8"

LC_MONETARY="en_US.UTF-8"

LC_NUMERIC="en_US.UTF-8"

LC_TIME="en_US.UTF-8"

LC_ALL="en_US.UTF-8"

We had to open a new mac user account and on this account GRASS GIS has the same error but does open. The text we are getting is the following:

/usr/bin/env -i HOME=/Users/Gabriela? PATH=/usr/bin:/bin:/usr/sbin:/etc:/usr/lib /Applications/GRASS-7.4.1.app/Contents/MacOS/Grass.sh

android-db3310249737a4f2:~ Gabriela$ /usr/bin/env -i HOME=/Users/Gabriela? PATH=/usr/bin:/bin:/usr/sbin:/etc:/usr/lib /Applications/GRASS-7.4.1.app/Contents/MacOS/Grass.sh

Rebuilding Addon HTML manual pages index...

Rebuilding Addon menu...

Default locale not found, using UTF-8

WARNING: Default locale settings are missing. GRASS running with C locale.

Cleaning up temporary files...

access: No such file or directory

ERROR: LOCALIZACIÓN </Users/Gabriela/Documents/Los?

Andes/Biología?/grassdata/nc_spm_08_grass7> no disponible

Starting GRASS GIS...

Traceback (most recent call last):

File "/Applications/GRASS-7.4.1.app/Contents/Resources/gui/wxpython/gis_set.py", line 1236, in OnInit?

StartUp? = GRASSStartup()

File "/Applications/GRASS-7.4.1.app/Contents/Resources/gui/wxpython/gis_set.py", line 233, in init

self._set_properties(grassVersion, grassRevisionStr)

File "/Applications/GRASS-7.4.1.app/Contents/Resources/gui/wxpython/gis_set.py", line 286, in _set_properties

self.OnSetDatabase?(None)

File "/Applications/GRASS-7.4.1.app/Contents/Resources/gui/wxpython/gis_set.py", line 985, in OnSetDatabase?

self._showError(_("Path '%s' doesn't exist.") % gisdbase)

File "/Applications/GRASS-7.4.1.app/Contents/Resources/gui/wxpython/gis_set.py", line 511, in _showError

self.lmessage.SetLabel?(_("Error: {text}").format(text=text))

UnicodeEncodeError?: 'ascii' codec can't encode character u'\xed' in position 48: ordinal not in range(128)

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

grass74 --help

See also: https://grass.osgeo.org/grass74/manuals/helptext.html

Exiting...

comment:11 Changed 2 years ago by cmbarton

Could you please give us the source of your Mac binary and when you got it?

comment:12 Changed 2 years ago by cmbarton

Also, what language is your Mac system set to?

comment:13 Changed 2 years ago by cgarzon

The source of the Mac binary is:

http://grassmac.wikidot.com/downloads GRASS 7.4.1 stable. And we installed it approx. 3 weeks ago.

The language in the Mac system is:

MacBook?-Pro-de-Gabriela-2:~ Gabriela$ defaults read -g AppleLanguages? (

"es-CO", "en-US"

)

comment:14 Changed 2 years ago by cmbarton

Thanks. It is a recent download from my site then. Should work. BUT...

Check System Preferences (under apple menu) and then the Language & Region settings. If it is not set to English, set it to English and see if this fixes the problem.

IIRC, somehow the GUI code does not read the Unix type language setting for the Mac or it reads it incorrectly. Then there is some kind of weird conflict between the Mac Preferences and the type of settings you might put in a .profile statement.

comment:15 Changed 2 years ago by neteler

Milestone: 7.4.27.4.3

Ticket retargeted after milestone closed

comment:16 Changed 22 months ago by martinl

Milestone: 7.4.37.4.4

Bump milestone to 7.4.4

comment:17 Changed 21 months ago by neteler

Milestone: 7.4.47.4.5

Ticket retargeted after milestone closed

comment:18 Changed 6 weeks ago by wenzeslaus

Resolution: fixed
Status: newclosed

After transition to Python 3 when a lot of encoding issues was fixed, I'm assuming this issue fixed. If you have problems, please open a new issue on GitHub.

Note: See TracTickets for help on using tickets.