TransWikia.com

DLL error in various GDAL installations

Geographic Information Systems Asked by Symbionte on November 1, 2021

I have a couple virtual machines with Python (2.7.16 and 3.6.6 – 64 bit) with GDAL installed using GIS internals installers and using this process

However when running gdalinfo --version on the shell, in both I get an error:

C:UsersK>gdalinfo --version
ERROR 1: Can't load requested DLL: C:Program Files (x86)GDALgdalpluginsogr_MSSQLSpatial.dll
126: No se puede encontrar el m¾dulo especificado.

ERROR 1: Can't load requested DLL: C:Program Files (x86)GDALgdalpluginsogr_MSSQLSpatial.dll
126: No se puede encontrar el m¾dulo especificado.

GDAL 2.2.3, released 2017/11/20


C:UsersK>gdalinfo --version
ERROR 1: Can't load requested DLL: C:Program FilesGDALgdalpluginsogr_MSSQLSpatial.dll
126: No se puede encontrar el m¾dulo especificado.

ERROR 1: Can't load requested DLL: C:Program FilesGDALgdalpluginsogr_MSSQLSpatial.dll
126: No se puede encontrar el m¾dulo especificado.

GDAL 2.4.0, released 2018/12/14

The dll is located in the gdalplugins folder. Why does it fail in both installations?

2 Answers

OP, ok so I'm the author of the cartometric.com blog resource you followed that left you with this issue. :) Turns out, I just retraced my steps that process while installing a fresh copy of GDAL on my work desktop (Win 7/64 bit, but I use 32-bit Python and GDAL), and I encountered the same problem.

For people that run into this issue, if you don't need the MS SQL Server support, as @baal described, you can delete or rename the ogr_MSSQLSpatial.dll file. It's located at.. 64-bit: C:Program FilesGDALgdalplugins 32-bit: C:Program Files (x86)GDALgdalplugins

If you're like me and it bothers you to have the error, and you don't want to surrender MS SQL Server support just because of some file ..the solution is mentioned by Tamas in this old thread:

This is probably because the SQL Server Native Client is not installed on the system. You could either install the MS SQL Native Client 11 x64 driver or reinstall GDAL without the MSSQL BCP driver or just simply remove ogr_MSSQLSpatial.dll from the gdalplugins subdirectory.

Tamas is the maintainer of the GDAL binaries my approach recommends so we can gain some confidence from his suggestion. Ultimately, the answer is "Install SQL Server Native Client" ..if you're in 64-bit land, I have a hunch if you follow that advice at face value you will experience no further issues.

However, in my case (Win 7, 32-bit Python/GDAL), it was a bit difficult to find the correct files. But I eventually got it loading without error by installing select elements from Microsoft SQL Server® 2012 SP4 Feature Pack. (Hopefully that link remains alive for awhile.) Specifically, I installed these three, in this order:

  • sqlncli.msi
  • SqlCmdLnUtils.msi
  • SQLSysClrTypes.msi

Super unfortunately, the Microsoft downloader makes it impossible to know which installer is 32-bit or 64-bit. My strategy was to download both installers for each element (six files), then I installed the "(1)" version of each, e.g. "sqlncli(1).msi", etc. Then I tested ogrinfo --version, and everything worked.

If I still had the same error, I was going to install the "not (1)" version of each, e.g. "sqlncli(1).msi", etc. Then retest ogrinfo. Fortunately it didn't come to that in my case.

My semi-educuated expectation here was that both the 32- and 64-bit versions of these might be able to live side-by-side on the same system, and if so, and if the correct SQL Native Client version was in place, it would just work.

Final aside: You probably don't need "SQLSysClrTypes.msi", but I installed it anyway because I'm pretty sure that library provides some useful spatial types available to C# development.

Answered by elrobis on November 1, 2021

I had the same problem today and my workaround was to simply remove the ogr_MSSQLSpatial.dll from the gdalplugins folder. An alternative could be to install the SQL Server Native Client for Windows if needed.

Answered by baal on November 1, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP