Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing dependency: gdal #7

Open
mosoriob opened this issue Jul 28, 2021 · 3 comments
Open

Missing dependency: gdal #7

mosoriob opened this issue Jul 28, 2021 · 3 comments

Comments

@mosoriob
Copy link

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
Copy link
Author

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
Copy link
Author

mosoriob commented Jul 28, 2021

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

@dan771
Copy link

dan771 commented May 4, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants