Installation and Configuration¶
smif is written in Python (Python>=3.5) and has a number of dependencies. See requirements.txt for a full list.
Using conda¶
The recommended installation method is to use conda, which handles packages and virtual environments, along with the conda-forge channel which has a host of pre-built libraries and packages.
Create a conda environment:
conda create --name smif_env python=3.6
Activate it (run each time you switch projects):
conda activate smif_env
Add the conda-forge channel, which has smif available:
conda config --add channels conda-forge
Finally install smif
:
conda install smif
Installing smif with other methods¶
Once the dependencies are installed on your system, a normal installation of smif can be achieved using pip on the command line:
pip install smif
Versions under development can be installed from github using pip too:
pip install git+http://github.com/nismod/smif
To install from the source code in development mode:
git clone http://github.com/nismod/smif
cd smif
python setup.py develop
Spatial libraries¶
smif
optionally depends on fiona and shapely, which depend on the GDAL and GEOS libraries. These
add support for reading and writing common spatial file formats and for spatial data
conversions.
If not using conda, on Mac or Linux these can be installed with your OS package manager:
# On debian/Ubuntu:
apt-get install gdal-bin libspatialindex-dev libgeos-dev
# or on Mac
brew install gdal
brew install spatialindex
brew install geos
Then to install the python packages, run:
pip install smif[spatial]