I am running a python script which calibrates a hydrologic model, this script uses gdal from Osgeo. Following is the command I am giving python:
from osgeo import gdal
infile="G:\ARORA\vic_inputs\routing_files\new_basin\sutlej_beas_new_fraction.tif"
ds = gdal.Open(infile,gdal.GA_ReadOnly)
b1 = ds.GetRasterBand(band)
b1 gives the following error:
AttributeError Traceback (most recent call last)
<ipython-input-33-ba605a73e25c> in <module>()
----> 1 b1 = ds.GetRasterBand(band)
AttributeError: 'NoneType' object has no attribute 'GetRasterBand'
The type(ds) returns NoneType.
What could be wrong here?