You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm unsure if this should be an issue, it's more like a tip.
I've had a lot of problems to install GDAL in a self-contained way for this addon.
I was hit with the terrible .dll error:
`>>> from osgeo import gdal
ERROR 1: Can't load requested DLL: C:\Program Files\GDAL\gdalplugins\gdal_FITS.dll
127: The specified procedure could not be found.
ERROR 1: Can't load requested DLL: C:\Program Files\GDAL\gdalplugins\gdal_FITS.dll
127: The specified procedure could not be found.`
Hi,
I'm unsure if this should be an issue, it's more like a tip.
I've had a lot of problems to install GDAL in a self-contained way for this addon.
I was hit with the terrible .dll error:
`>>> from osgeo import gdal
ERROR 1: Can't load requested DLL: C:\Program Files\GDAL\gdalplugins\gdal_FITS.dll
127: The specified procedure could not be found.
ERROR 1: Can't load requested DLL: C:\Program Files\GDAL\gdalplugins\gdal_FITS.dll
127: The specified procedure could not be found.`
My solution was to edit the init.py file to this:
`# init for osgeo package.
from sys import version_info
import os
try:
_here = os.path.dirname(file)
os.environ['GDAL_DATA'] = os.path.join(_here, 'data', 'gdal')
os.environ['PATH'] = _here + ';' + os.environ['PATH']
os.environ['PROJ_LIB'] = os.path.join(_here, 'data', 'proj')
os.environ['GDAL_DRIVER_PATH'] = os.path.join(_here, 'gdalplugins')
os.add_dll_directory(_here)
except Exception:
pass
from . import _gdal
version = _gdal.version = _gdal.VersionInfo("RELEASE_NAME")
gdal_version = tuple(int(s) for s in str(version).split('.') if s.isdigit())[:3]
python_version = tuple(version_info)[:3]
`
doing this FORCES python to use the local, self-contained gdal install instead of any system one. It also protects your path
The text was updated successfully, but these errors were encountered: