CosmiQ / solaris

CosmiQ Works Geospatial Machine Learning Analysis Toolkit
https://solaris.readthedocs.io
Apache License 2.0
411 stars 112 forks source link

[BUG]: (necessity of gdal related lines in setup.py especially for windows installation?) #456

Open Sadrim-71 opened 2 years ago

Sadrim-71 commented 2 years ago

Firstly I should thank every efforts behind this exciting python library.

but it seems that installation process is not as easy as it seems.

A bug which is sometimes reported by the users is that gdal is installed and when they run "pip install ." an error raises about gdal which says it should be installed for Solaris. and when the user checks the installed packages, surprisingly gdal is available in the list.

when I investigated setup.py in details, I figured out the problem is due to an environment variable named gdal-config. based on gdal documentation, gdal-config is an utility script available on UNIX systems which can be used to determine various information about a GDAL installation. https://gdal.org/programs/gdal-config.html#

try: gdal_version = subprocess.check_output( ['gdal-config', '--version']).decode('utf') gdal_config = os.environ.get('GDAL_CONFIG', 'gdal-config')

except Exception: sys.exit("GDAL must be installed to use solaris. See the documentation " "for more info. We recommend installing GDAL within a conda " "environment first, then installing solaris there.")

besides, I didn't see any usage of above lines except only checking of GDAL being installed. and we can make sure that gdal is installed by other ways like import gdal/ from osgeo import gdal and if nothing happens it means that gdal is installed.

so I think those lines can be commented out and then running pip install . would be done without any exception.

if my conclusion is correct please verify me.

thanks alot