-
Notifications
You must be signed in to change notification settings - Fork 5
Installation
IHEWA Python tools is developed in Python 3.7 environment. We recommend Anaconda3 distribution of Python for simple Python environment and packages manager.
We suggest to install Anaconda3. It is a free and open-source distribution of the Python and R programming languages for scientific computing (data science, machine learning applications, large-scale data processing, predictive analytics, etc.), that aims to simplify package management and deployment. After installing Anaconda3, a Python 3.7 environment must be created since the base environment of the latest Anaconda release is 3.8. First, start Anaconda prompt with Run as administrator.
In Anaconda prompt, type in the command:
conda create python=3.7 --name ihewa
To activate this environment, use the command:
conda activate ihewa
The following table lists most of the important packages required. The full list can be found from “requirements.txt” file in the package repository. To install these packages, open Anaconda prompt and activate the working environment (Python 3.7). Then, run the installation command provided in the ‘Installation command” column of the table.
GDAL is used as the core engine to dealing with geospatial data. If you have not installed GDAL before or if you start from a clean installation of Anaconda, then GDAL should be installed before python can use it. Follow the following steps to install GDAL.
GDAL can be found from different places.
- The source code is located at https://github.com/OSGeo/gdal.
- The unofficial windows binary file is hosted on https://www.lfd.uci.edu/~gohlke/pythonlibs/#gdal
- The Tamas Szekeres’ windows binaries can be downloaded from http://www.gisinternals.com/release.php
The following steps are to install GDAL from the binaries downloaded from Tamas Szekeres’ window binaries solution.
- Before download the binary files, check which version you need. This is concerned with the MSVC version used to compile python and the windows version. Open command window or Anaconda command and
python
to start python.
The version number from the screenshot is v.1916 and the operating system is 64 bit (AMD64). MSC v.1916 corresponds to MSVC 2017 (see https://en.wikipedia.org/wiki/Microsoft_Visual_C%2B%2B).
- Find the corresponding binaries from the link http://www.gisinternals.com/release.php. For the above case, the corresponding link is as shown below in the screenshot.
Selecting a release will take you to a new screen promoting a handful of EXE and MSI files. First, download and install the core components of GDAL which is the MSI file corresponding to your python setup. For the above case, the corresponding MSI file is as shown in the screenshot below.
After downloading the installation msi file, double click it and the installation will start.
Select Complete option.
After installing GDAL, the next step is to set system path of GDAL, where the system can find the executable files and the data. If you install GDAl from windows binaries, the default installation path is C:\Program Files\GDAL.
- Open Control Panel
- Go to System
- Find the Advanced system settings on the left side panel
- Click it then a system properties window will pop up
- Under Advanced tab, click the Environment Variables button to open the Environmental Variables window
- Select path in the users variable and click on Edit… to open the Edit environmental variable window
- Click New and add the GDAL path C:\Program Files\GDAL
- Close the above window and click Edit… under the System Variable to open the Edit System variable window
- Add a path variable called GDAL_DATA and set the value to C:\Program Files\GDAL\gdal-data
- Add the same way GDAL_DRIVER_PATH
To validate the installation, open cmd and type
gdalinfo --version
If you see the gdal version information, the installation is successful
- Download python wrapper from the same website. The installation MSI file should fit the python version on your system.
- Install the wrapper.
- Validate gdal import. Open the cmd or Anaconda prompt and start python. Inside the python running environment import gdal.
IHEWAcollect package is hosted on the Python Package Index (PyPI) repository and can be installed using pip packages manager
- From PyPi: IHEWAcollect is hosted on PyPi as a python package. To install it from PyPi, type
pip install IHEWAcollect
. All the dependencies will be installed automatically. - From source code: First clone the source code from github repository. Under the root folder of the repository type
python setup.py install
.
Please report your issues in the Issues section