Runtime Error: Can't load requested DLL: C:\Program Files (x86)\GDAL\gdalplugins\gdal_netCDF.dll

1,547 views
Skip to first unread message

Matt King

unread,
Feb 9, 2017, 6:00:40 PM2/9/17
to VisTrails SAHM
Hello SAHM group,

I just tried to install VisTrails SAHM for the first time and am coming up with this error when trying to enable the 'sahm' package in VisTrails:

CRITICAL
2017-02-09 15:35:24,845
C:\VisTrails_SAHM\vistrails\gui\preferences.py, line 326
Initialization of package 'sahm' failed
InitializationFailed: Package 'SAHM' failed to initialize because of the following exceptions:
Traceback (most recent call last):
  File "C:\VisTrails_SAHM\vistrails\core\modules\module_registry.py", line 1635, in initialize_package
    package.initialize()
  File "C:\VisTrails_SAHM\vistrails\core\modules\package.py", line 427, in initialize
    __import__(name, globals(), locals(), [])
  File "C:\VisTrails_SAHM\vistrails\core\packagemanager.py", line 262, in _import_override
    return self._orig_import(name, globals, locals, fromlist, level)
  File "C:\VisTrails_SAHM\vistrails\packages\sahm\init.py", line 50, in <module>
    from SelectPredictorsLayers import SelectListDialog
  File "C:\VisTrails_SAHM\vistrails\core\packagemanager.py", line 250, in _import_override
    package_importing_directly=True)
  File "C:\VisTrails_SAHM\vistrails\core\modules\package.py", line 309, in import_override
    res = orig_import(name, globals, locals, fromlist, level)
  File "C:\VisTrails_SAHM\vistrails\packages\sahm\SelectPredictorsLayers.py", line 48, in <module>
    import utils
  File "C:\VisTrails_SAHM\vistrails\core\packagemanager.py", line 250, in _import_override
    package_importing_directly=True)
  File "C:\VisTrails_SAHM\vistrails\core\modules\package.py", line 309, in import_override
    res = orig_import(name, globals, locals, fromlist, level)
  File "C:\VisTrails_SAHM\vistrails\packages\sahm\utils.py", line 74, in <module>
    from CreatePredictorCurves import CreatePredictorCurvesDialog
  File "C:\VisTrails_SAHM\vistrails\core\packagemanager.py", line 250, in _import_override
    package_importing_directly=True)
  File "C:\VisTrails_SAHM\vistrails\core\modules\package.py", line 309, in import_override
    res = orig_import(name, globals, locals, fromlist, level)
  File "C:\VisTrails_SAHM\vistrails\packages\sahm\CreatePredictorCurves.py", line 69, in <module>
    import pySAHM.SpatialUtilities as SpatialUtilities
  File "C:\VisTrails_SAHM\vistrails\core\packagemanager.py", line 250, in _import_override
    package_importing_directly=True)
  File "C:\VisTrails_SAHM\vistrails\core\modules\package.py", line 309, in import_override
    res = orig_import(name, globals, locals, fromlist, level)
  File "C:\VisTrails_SAHM\vistrails\packages\sahm\pySAHM\SpatialUtilities.py", line 18, in <module>
    gdal.AllRegister()
RuntimeError: Can't load requested DLL: C:\Program Files (x86)\GDAL\gdalplugins\gdal_netCDF.dll
193: %1 is not a valid Win32 application.

It seems like there is something going on with gdal_netCDF.dll. The DLL file is in the expected directory.

I'm on Windows 7, 64-bit. I have installed GDAL on my machine previously to use the 'rgdal' package in R.

Any advice? I don't recall if my GDAL installation was 32 or 64 bit. I expect I'll need to re-install GDAL to a 32 bit version, but I'm curious if folks here have ran into this issue. I'm also concerned doing this might mess up my rgdal package.

Thanks!
-Matt

Matt King

unread,
Feb 10, 2017, 10:20:35 AM2/10/17
to VisTrails SAHM
UPDATE: A temporary solution is to just hide those DLL files in C:\Program Files (x86)\GDAL\gdalplugins\gdal_netCDF.dll in a different folder. Then, the SAHM package seems to be loading fine, though I haven't tested anything thoroughly since I'm new to VisTrails. 

Is there better way to tell SAHM to stop looking for those DLLs in C:\Program Files (x86)\GDAL\gdalplugins\gdal_netCDF.dll? This doesn't seem like a great fix....

-Matt

Michelle Fink

unread,
Feb 13, 2017, 4:28:46 PM2/13/17
to VisTrails SAHM
Hi Matt,

I think the issue is that the version of gdal that sahm uses requires the Microsoft Visual C++ 2008 Redistributable package. I had similar "is not a valid Win32 application" errors when trying to initialize sahm until I finally figured out what was missing. You can download and install the package from Microsoft. Sahm is 64-bit, but I see that I have both x64 and x86 versions of Visual C++ 2008 installed, so it might require both. I can't honestly remember now.

--Michelle


On Thursday, February 9, 2017 at 4:00:40 PM UTC-7, Matt King wrote:

Matt King

unread,
Feb 13, 2017, 7:41:07 PM2/13/17
to VisTrails SAHM
Thanks for the reply, Michelle! That's a good idea about the x64 and x86 distributions of MSVC 2008, but looks like I have both versions installed. 

I wonder if this has something to do with my version of GDAL being linked to my PATH variable, maybe interfering somehow with where SAHM expects to find it's own version of GDAL?

Thankfully, it seems as though SAHM is at least loading properly after hiding the DLLs in the plugins folder. I will get a chance to do some test runs in the next few days and know for sure if things are running properly.
Reply all
Reply to author
Forward
0 new messages