peckhams / topoflow36

TopoFlow is a component-based, spatial hydrologic model along with a large collection of utilities for data preparation, visualization and so on. Distributed as a Python package and version 3.6 has been updated to run in Python 3.*.
MIT License
25 stars 10 forks source link

Missing dependency: gdal #7

Open mosoriob opened 3 years ago

mosoriob commented 3 years ago

The setup.py doesn't include a reference to the gdal package


ERROR: Could not find RTI file for:
      /tmp/TF_Tests/Tana_120sec/__topo/Tana_120sec.rti

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-7-c289afbe6c07> in <module>
      6 rti_file    = topo_dir + site_prefix + '.rti'
      7 grid_info   = rti_files.read_info( rti_file )  # needed for DEM ncols & nrows
----> 8 from topoflow.utils import regrid

/opt/conda/lib/python3.7/site-packages/topoflow/utils/regrid.py in <module>
     40 #-------------------------------------------------------------------
     41 import numpy as np
---> 42 import gdal, osr  ## ogr
     43 import glob, sys
     44 import os, os.path

ModuleNotFoundError: No module named 'gdal'
mosoriob commented 3 years ago

Note: Some of the new TopoFlow utilities use a Python package version of GDAL. At the time of this writing, installing gdal from the conda-forge with conda install -c conda-forge gdal did not work.

mosoriob commented 3 years ago

@peckhams Regarding the CHIRPS data, should I use the GDAL from pypi?

dan771 commented 4 months ago

You have to manually add GDAL and osr to the path a quick fix is to use

from osgeo import gdal, osr

sys.modules["gdal"] = gdal
sys.modules["osr"] = osr