returns No module named 'gdal'
However the gdal manual states, that import gdal is deprecated and should be replaced by from osgeo import gdal
I installed gdal with
conda install -c conda-forge gdal
and importing with from osgeo import gdal results in no issues, so gdal is installed correctly.
but doing so in the script returns issues:
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Input In [3], in <cell line: 29>()
27 # Setup the figure
28 s1= figure(title="H",plot_width=cols, plot_height=rows, x_range=[0, cols], y_range=[0, rows])
---> 29 s1.axis.visible = None
30 s1.image(image=[np.flipud(H)],x=[0],y=[0],dw=cols,dh=rows,color_mapper=map_LE)
31 s2= figure(title="LE",plot_width=cols, plot_height=rows, x_range=s1.x_range, y_range=s1.y_range)
File ~/anaconda3/envs/pyTSEB/lib/python3.10/site-packages/bokeh/models/plots.py:787, in _list_attr_splat.__setattr__(self, attr, value)
785 def __setattr__(self, attr, value):
786 for x in self:
--> 787 setattr(x, attr, value)
File ~/anaconda3/envs/pyTSEB/lib/python3.10/site-packages/bokeh/core/has_props.py:230, in HasProps.__setattr__(self, name, value)
228 properties = self.properties(_with_props=True)
229 if name in properties:
--> 230 return super().__setattr__(name, value)
232 descriptor = getattr(self.__class__, name, None)
233 if isinstance(descriptor, property): # Python property
File ~/anaconda3/envs/pyTSEB/lib/python3.10/site-packages/bokeh/core/property/descriptors.py:283, in PropertyDescriptor.__set__(self, obj, value, setter)
280 class_name = obj.__class__.__name__
281 raise RuntimeError(f"{class_name}.{self.name} is a readonly property")
--> 283 value = self.property.prepare_value(obj, self.name, value)
284 old = self._get(obj)
285 self._set(obj, old, value, setter=setter)
File ~/anaconda3/envs/pyTSEB/lib/python3.10/site-packages/bokeh/core/property/bases.py:365, in Property.prepare_value(self, owner, name, value, hint)
363 else:
364 obj_repr = owner if isinstance(owner, HasProps) else owner.__name__
--> 365 raise ValueError(f"failed to validate {obj_repr}.{name}: {error}")
367 if isinstance(owner, HasProps):
368 obj = owner
ValueError: failed to validate LinearAxis(id='1015', ...).visible: expected a value of type bool or bool_, got None of type NoneType
https://github.com/hectornieto/pyTSEB/blob/669a8bac8b83d6c6e1ea009efc7728ea6535db56/ProcessLocalImage.ipynb?short_path=cf81b66#L92
returns
No module named 'gdal'
However the gdal manual states, thatimport gdal
is deprecated and should be replaced byfrom osgeo import gdal
I installed gdal with
conda install -c conda-forge gdal
and importing withfrom osgeo import gdal
results in no issues, so gdal is installed correctly.but doing so in the script returns issues:
tested with Python Version: 3.10.4