Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#661 closed defect (fixed)

libgrass_gis.7.8 Not Found

Reported by: PedroNGV Owned by: osgeo4w-dev@…
Priority: major Component: Package
Version: Keywords: grass, testing repo
Cc:

Description

When I run GRASS 7.8.5 I try to start a new session I get:

Cleaning up temporary files...
D1/1: G_set_program_name(): clean_temp
D1/1: G_set_program_name(): db.connect
D1/1: Creating new default DB params with db_set_default_connection()

          __________  ___   __________    _______________
         / ____/ __ \/   | / ___/ ___/   / ____/  _/ ___/
        / / __/ /_/ / /| | \__ \\_  \   / / __ / / \__ \
       / /_/ / _, _/ ___ |___/ /__/ /  / /_/ // / ___/ /
       \____/_/ |_/_/  |_/____/____/   \____/___//____/

Welcome to GRASS GIS 7.8.5
GRASS GIS homepage:                      https://grass.osgeo.org
This version running through:            Command Prompt (C:\WINDOWS\system32\cmd.exe)
Help is available with the command:      g.manual -i
See the licence terms with:              g.version -c
See citation options with:               g.version -x
If required, restart the GUI with:       g.gui wxpython
When ready to quit enter:                exit

Launching <wxpython> GUI in the background, please wait...
Microsoft Windows [Version 10.0.19042.804]
(c) 2020 Microsoft Corporation. Todos os direitos reservados.

C:\OSGeo4W64\bin>D1/1: G_set_program_name(): g.gisenv
D1/1: grass.script.core.start_command(): g.gisenv -n
D1/1: G_set_program_name(): g.gisenv
wxnviz.py: Could not find module 'C:\OSGEO4~1\apps\grass\grass78\lib\libgrass_gis.7.8.dll' (or one of its dependencies). Try using the full path with constructor syntax.
wxdigit.py: Could not find module 'C:\OSGEO4~1\apps\grass\grass78\lib\libgrass_gis.7.8.dll' (or one of its dependencies). Try using the full path with constructor syntax.
Traceback (most recent call last):
  File "C:\OSGEO4~1\apps\grass\grass78\gui\wxpython\wxgui.py", line 104, in OnInit
    from lmgr.frame import GMFrame
  File "C:\OSGEO4~1\apps\grass\grass78\gui\wxpython\lmgr\frame.py", line 51, in <module>
    from lmgr.layertree import LayerTree, LMIcons
  File "C:\OSGEO4~1\apps\grass\grass78\gui\wxpython\lmgr\layertree.py", line 38, in <module>
    from mapdisp.frame import MapFrame
  File "C:\OSGEO4~1\apps\grass\grass78\gui\wxpython\mapdisp\frame.py", line 43, in <module>
    from mapwin.buffered import BufferedMapWindow
  File "C:\OSGEO4~1\apps\grass\grass78\gui\wxpython\mapwin\buffered.py", line 52, in <module>
    import grass.lib.gis as gislib
  File "C:\OSGEO4~1\apps\grass\grass78\etc\python\grass\lib\gis.py", line 23, in <module>
    _libs["grass_gis.7.8"] = load_library("grass_gis.7.8")
  File "C:\OSGEO4~1\apps\grass\grass78\etc\python\grass\lib\ctypes_loader.py", line 62, in load_library
    return self.load(path)
  File "C:\OSGEO4~1\apps\grass\grass78\etc\python\grass\lib\ctypes_loader.py", line 240, in load
    return _WindowsLibrary(path)
  File "C:\OSGEO4~1\apps\grass\grass78\etc\python\grass\lib\ctypes_loader.py", line 223, in __init__
    self.cdll = ctypes.cdll.LoadLibrary(path)
  File "C:\OSGEO4~1\apps\Python39\lib\ctypes\__init__.py", line 452, in LoadLibrary
    return self._dlltype(name)
  File "C:\OSGEO4~1\apps\Python39\lib\ctypes\__init__.py", line 374, in __init__
    self._handle = _dlopen(self._name, mode)
FileNotFoundError: Could not find module 'C:\OSGEO4~1\apps\grass\grass78\lib\libgrass_gis.7.8.dll' (or one of its dependencies). Try using the full path with constructor syntax.
OnInit returned false, exiting...

GRASS installed from new installer (testing repo).

Attachments (3)

Screenshot_20210225_170849.png (62.2 KB ) - added by lutra 4 years ago.
depwalk_bin.log (34.6 KB ) - added by PedroNGV 4 years ago.
depwalk_lib.zip (53.8 KB ) - added by PedroNGV 4 years ago.

Download all attachments as: .zip

Change History (25)

comment:1 by PedroNGV, 4 years ago

I must say that libgrass_gis.7.8.dll exists in that path:

..\OSGeo4W64\apps\grass\grass78\lib\libgrass_gis.7.8.dll

in reply to:  1 ; comment:2 by jef, 4 years ago

Replying to PedroNGV:

I must say that libgrass_gis.7.8.dll exists in that path:

..\OSGeo4W64\apps\grass\grass78\lib\libgrass_gis.7.8.dll

Just like with gdal302.dll. Any other conflicting DLLs in system32 - or maybe even libcurl.dll?

in reply to:  2 comment:3 by PedroNGV, 4 years ago

Just like with gdal302.dll. Any other conflicting DLLs in system32 - or maybe even libcurl.dll?

I don't think so Jurgen,

This is happening in both machines, gdal302.dll issue only happens in the machine where I don't have admin rights to remove curl from System32.

So, I can't say for sure it isn't some kind of conflict, but for instance GRASS 7.8.5 from QGIS 3.16.3 standalone works fine.

by lutra, 4 years ago

comment:4 by lutra, 4 years ago

I have the same error on clean osgeo4w install (new installer) on a clean Win10 machine in pt_PT.

Moreover when starting GRASS in the first dialog (the one that allows to choose a location/mapsert or to create a new one) the option to create a location/mapset is broken

See this screenshot

https://trac.osgeo.org/osgeo4w/attachment/ticket/661/Screenshot_20210225_170849.png

comment:5 by PedroNGV, 4 years ago

This issue is still true with GRASS 7.8.5-4.

in reply to:  4 ; comment:6 by hellik, 4 years ago

Replying to lutra:

I have the same error on clean osgeo4w install (new installer) on a clean Win10 machine in pt_PT.

Moreover when starting GRASS in the first dialog (the one that allows to choose a location/mapsert or to create a new one) the option to create a location/mapset is broken

See this screenshot

https://trac.osgeo.org/osgeo4w/attachment/ticket/661/Screenshot_20210225_170849.png

are there any special characters in the installation path or in the path where grass data is installed?

in reply to:  6 ; comment:7 by lutra, 4 years ago

are there any special characters in the installation path or in the path where grass data is installed?

no.

in reply to:  7 ; comment:8 by hellik, 4 years ago

Replying to lutra:

are there any special characters in the installation path or in the path where grass data is installed?

no.

Are there addons from an earlier OSGeo4W Installation?

in reply to:  8 ; comment:9 by lutra, 4 years ago

Are there addons from an earlier OSGeo4W Installation?

No, completely fresh Win10 install.

in reply to:  9 comment:10 by hellik, 4 years ago

Replying to lutra:

Are there addons from an earlier OSGeo4W Installation?

No, completely fresh Win10 install.

See

https://lists.osgeo.org/pipermail/grass-dev/2021-March/095019.html

comment:11 by jef, 4 years ago

Resolution: fixed
Status: newclosed

wxpython updated to 4.1.1 and corresponding wxwidgets and added use of os.add_dll_directory in wxgui.py (necessary in Python 3.9). Changes see jef-n/OSGeo4W@9443c34538ae)

comment:12 by PedroNGV, 4 years ago

Hi Jurgen,

Thanks for the fix!

But I've this one now:

Starting GRASS GIS...
ATENÇÃO: Concurrent mapset locking is not supported on Windows
Cleaning up temporary files...

          __________  ___   __________    _______________
         / ____/ __ \/   | / ___/ ___/   / ____/  _/ ___/
        / / __/ /_/ / /| | \__ \\_  \   / / __ / / \__ \
       / /_/ / _, _/ ___ |___/ /__/ /  / /_/ // / ___/ /
       \____/_/ |_/_/  |_/____/____/   \____/___//____/

Welcome to GRASS GIS 7.8.5
GRASS GIS homepage:                      https://grass.osgeo.org
This version running through:            Command Prompt (C:\windows\system32\cmd.exe)
Help is available with the command:      g.manual -i
See the licence terms with:              g.version -c
See citation options with:               g.version -x
If required, restart the GUI with:       g.gui wxpython
When ready to quit enter:                exit

Launching <wxpython> GUI in the background, please wait...
Microsoft Windows [Version 10.0.17763.1518]
(c) 2018 Microsoft Corporation. Todos os direitos reservados.

C:\Users\pedrovenancio\Documents>Traceback (most recent call last):
  File "C:\OSGEO4~1\apps\grass\grass78\gui\wxpython\wxgui.py", line 110, in OnInit
    mainframe = GMFrame(parent=None, id=wx.ID_ANY,
  File "C:\OSGEO4~1\apps\grass\grass78\gui\wxpython\lmgr\frame.py", line 143, in __init__
    self.notebook = self._createNoteBook()
  File "C:\OSGEO4~1\apps\grass\grass78\gui\wxpython\lmgr\frame.py", line 333, in _createNoteBook
    self.goutput = GConsoleWindow(
  File "C:\OSGEO4~1\apps\grass\grass78\gui\wxpython\gui_core\goutput.py", line 118, in __init__
    self.cmdPrompt = GPromptSTC(parent=self, menuModel=self._menuModel)
  File "C:\OSGEO4~1\apps\grass\grass78\gui\wxpython\gui_core\prompt.py", line 138, in __init__
    GPrompt.__init__(self, parent=parent, menuModel=menuModel)
  File "C:\OSGEO4~1\apps\grass\grass78\gui\wxpython\gui_core\prompt.py", line 56, in __init__
    self.mapList = self._getListOfMaps()
  File "C:\OSGEO4~1\apps\grass\grass78\gui\wxpython\gui_core\prompt.py", line 100, in _getListOfMaps
    result['raster'] = grass.list_strings('raster')
  File "C:\OSGEO4~1\apps\grass\grass78\etc\python\grass\script\core.py", line 1282, in list_strings
    for line in read_command("g.list",
  File "C:\OSGEO4~1\apps\grass\grass78\etc\python\grass\script\core.py", line 503, in read_command
    return handle_errors(returncode, stdout, args, kwargs)
  File "C:\OSGEO4~1\apps\grass\grass78\etc\python\grass\script\core.py", line 342, in handle_errors
    raise CalledModuleError(module=None, code=code,
grass.exceptions.CalledModuleError: Module run None g.list --q -m type=raster ended with error
Process ended with non-zero return code 3221225785. See errors in the (error) output.
OnInit returned false, exiting...

in reply to:  12 comment:13 by PedroNGV, 4 years ago

But I've this one now:

This seems to not be related with this issue, so I confirm that the libgrass_gis.7.8 Not Found is fixed! Thank you very much Jurgen!

in reply to:  12 ; comment:14 by hellik, 4 years ago

Replying to PedroNGV:

Hi Jurgen,

Thanks for the fix!

But I've this one now:

Starting GRASS GIS...
ATENÇÃO: Concurrent mapset locking is not supported on Windows
Cleaning up temporary files...

          __________  ___   __________    _______________
         / ____/ __ \/   | / ___/ ___/   / ____/  _/ ___/
        / / __/ /_/ / /| | \__ \\_  \   / / __ / / \__ \
       / /_/ / _, _/ ___ |___/ /__/ /  / /_/ // / ___/ /
       \____/_/ |_/_/  |_/____/____/   \____/___//____/

Welcome to GRASS GIS 7.8.5
GRASS GIS homepage:                      https://grass.osgeo.org
This version running through:            Command Prompt (C:\windows\system32\cmd.exe)
Help is available with the command:      g.manual -i
See the licence terms with:              g.version -c
See citation options with:               g.version -x
If required, restart the GUI with:       g.gui wxpython
When ready to quit enter:                exit

Launching <wxpython> GUI in the background, please wait...
Microsoft Windows [Version 10.0.17763.1518]
(c) 2018 Microsoft Corporation. Todos os direitos reservados.

C:\Users\pedrovenancio\Documents>Traceback (most recent call last):
  File "C:\OSGEO4~1\apps\grass\grass78\gui\wxpython\wxgui.py", line 110, in OnInit
    mainframe = GMFrame(parent=None, id=wx.ID_ANY,
  File "C:\OSGEO4~1\apps\grass\grass78\gui\wxpython\lmgr\frame.py", line 143, in __init__
    self.notebook = self._createNoteBook()
  File "C:\OSGEO4~1\apps\grass\grass78\gui\wxpython\lmgr\frame.py", line 333, in _createNoteBook
    self.goutput = GConsoleWindow(
  File "C:\OSGEO4~1\apps\grass\grass78\gui\wxpython\gui_core\goutput.py", line 118, in __init__
    self.cmdPrompt = GPromptSTC(parent=self, menuModel=self._menuModel)
  File "C:\OSGEO4~1\apps\grass\grass78\gui\wxpython\gui_core\prompt.py", line 138, in __init__
    GPrompt.__init__(self, parent=parent, menuModel=menuModel)
  File "C:\OSGEO4~1\apps\grass\grass78\gui\wxpython\gui_core\prompt.py", line 56, in __init__
    self.mapList = self._getListOfMaps()
  File "C:\OSGEO4~1\apps\grass\grass78\gui\wxpython\gui_core\prompt.py", line 100, in _getListOfMaps
    result['raster'] = grass.list_strings('raster')
  File "C:\OSGEO4~1\apps\grass\grass78\etc\python\grass\script\core.py", line 1282, in list_strings
    for line in read_command("g.list",
  File "C:\OSGEO4~1\apps\grass\grass78\etc\python\grass\script\core.py", line 503, in read_command
    return handle_errors(returncode, stdout, args, kwargs)
  File "C:\OSGEO4~1\apps\grass\grass78\etc\python\grass\script\core.py", line 342, in handle_errors
    raise CalledModuleError(module=None, code=code,
grass.exceptions.CalledModuleError: Module run None g.list --q -m type=raster ended with error
Process ended with non-zero return code 3221225785. See errors in the (error) output.
OnInit returned false, exiting...

this looks like a dependency dll mismatch, see

https://grasswiki.osgeo.org/wiki/WinGRASS_errors#The_GRASS_GIS_exits_when_started_with_g.list_CalledModuleError_and_-1073741511_return_code

in reply to:  14 comment:15 by jef, 4 years ago

Replying to hellik:

this looks like a dependency dll mismatch, see

https://grasswiki.osgeo.org/wiki/WinGRASS_errors#The_GRASS_GIS_exits_when_started_with_g.list_CalledModuleError_and_-1073741511_return_code

So you have multiple sqlite3.dlls? Where? Why?

comment:16 by PedroNGV, 4 years ago

this looks like a dependency dll mismatch, see

This seems to be related with curl issue reported here: https://trac.osgeo.org/osgeo4w/ticket/662

https://cld.pt/dl/download/5a5e51f7-0278-4997-a820-d5f230999f00/grass_curl.jpg

comment:17 by PedroNGV, 4 years ago

The strange thing Jurgen is that I've already changed the order of curl entries in environment variables path to get the OSGeo4W one first

>where curl
C:\OSGeo4W64\bin\curl.exe
C:\Windows\System32\curl.exe

but the error persists.

in reply to:  17 ; comment:18 by hellik, 4 years ago

Replying to PedroNGV:

The strange thing Jurgen is that I've already changed the order of curl entries in environment variables path to get the OSGeo4W one first

>where curl
C:\OSGeo4W64\bin\curl.exe
C:\Windows\System32\curl.exe

but the error persists.

AFAIK the order of dll path search is:

(1) same folder where the executable lives (2) windows system folder (3) any other folder

Thus, in your case: Windows system folder wins over OSGeo4W folder

by PedroNGV, 4 years ago

Attachment: depwalk_bin.log added

by PedroNGV, 4 years ago

Attachment: depwalk_lib.zip added

comment:19 by PedroNGV, 4 years ago

Hi Helmut

I've removed curl.exe from system32 now:

>where curl
C:\OSGeo4W64\bin\curl.exe
>curl --version
curl 7.72.0 (x86_64-pc-win32) libcurl/7.72.0 OpenSSL/1.1.1h zlib/1.2.11 WinIDN
Release-Date: 2020-08-19
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: AsynchDNS HTTPS-proxy IDN IPv6 Kerberos Largefile NTLM SPNEGO SSL SSPI UnixSockets libz

But keep with the same error.

I've searched for dependency library issues with dependency walker, the output is attached. Can you take a look and see if it's something missing?

in reply to:  18 comment:20 by jef, 4 years ago

Replying to hellik:

AFAIK the order of dll path search is:

(1) same folder where the executable lives (2) windows system folder (3) any other folder

Thus, in your case: Windows system folder wins over OSGeo4W folder

Exactly. And that's what os.add_dll_directory (in Python 3.9; AddDllDirectory in C) gives you control over - but only for the current process.

in reply to:  19 ; comment:21 by jef, 4 years ago

Replying to PedroNGV:

I've removed curl.exe from system32 now:

the executable is not the culprit - a DLL is. BTW I have curl.exe in system32, but no libcurl.dll

in reply to:  21 comment:22 by PedroNGV, 4 years ago

Replying to jef:

but no libcurl.dll

Solved! :)

Thanks Jurgen and Helmut!

Note: See TracTickets for help on using tickets.