Skip to content

Developer Start Guidance

Huimin Liu edited this page Nov 13, 2019 · 14 revisions

macOS:

Install Homebrew

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Install Python 3.6+

  1. Install python version manager pyenv: brew install pyenv

  2. Use pyenv to check latest Python version: pyenv install --list | grep -E ' 3.[67].'

  3. Select one from the list and install the latest Python: pyenv install 3.7.4

    ** technically, you could use any 3.6 + version **

Install gdal:

brew install gdal

The tested version is gdal@2.4.2

Install PostgreSQL:

brew install postgresql

The tested version is postgresql@11.5_1

Then install Python packages:

  • Recommend to use a python virtualenv: pip install virtualenv create a virtual environment called venv: virtualenv venv or python3 -m venv venv then activate venv:source venv/bin/activate

  • Install all requirements: run cat requirements.txt | xargs pip install

  • if run into the error below:
    ld: library not found for -lssl
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    error: command 'gcc' failed with exit status 1

check this page

Linux (Ubuntu):

We are using Ubuntu as the deployment server. If you are using other linux or unix based system to develop, you are responsible to make sure it works or its dependencies work on Ubuntu

Git clone Wildfires:

git clone https://github.com/ISG-ICS/Wildfires.git

Install Python 3.6+:

sudo apt-get install python3.6

(To see which version of Python 3 you have installed, run python3 --version)

The tested version is Python 3.6.8

Install gdal:

sudo apt-get install python3-gdal

Install PostgreSQL:

sudo apt-get install postgresql

Then install Python packages:

  1. Make sure you have pop available, you can check this by running:pip3 --version if pip isn't already installed, then running:sudo apt-get install python3-pip
  • if run into the error below:
    Reading package lists... Done
    Building dependency tree
    Reading state information...Done
    E: Unable to locate package python3-pip

Please check this page

  1. While pip alone is sufficient to install from pre-built binary archives, up to date copies of the setuptools and wheel projects are useful to ensure you can also install from source archives: python3 -m pip install --upgrade pip setuptools wheel

  2. Recommend to create a virtual environment:python3 -m venv venv Then activate venv: source venv/bin/activate

  3. Install all requirements: cat Wildfires/requirements.txt | xargs pip3 install

  • when install torch, if run into the error below:
    MemoryError

Please check this page. You can run the install command based on your preferences and the environmrnt.

  • when install pybrib, if run into the error below:
    ImportError: eithor pyproj or basemap required

You can install pyproj package manually first by running pip3 install pyproj

  • when install gadl==2.4.2, if run into the error below:
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

Try to run:

    sudo add-apt-repository -y ppa:ubuntugis/ubuntugis-unstable
    sudo apt update
    sudo apt upgrade
    sudo apt install gdal-bin libgadal-dev
    pip3 install gadl==2.4.2