Skip to content

Instantly share code, notes, and snippets.

@jkariscodes
Last active February 9, 2022 12:20
Show Gist options
  • Save jkariscodes/fb7072dd3238fc6c7a1e4e6bf1ce08d0 to your computer and use it in GitHub Desktop.
Save jkariscodes/fb7072dd3238fc6c7a1e4e6bf1ce08d0 to your computer and use it in GitHub Desktop.
GeoNode 3.2 Advanced Installation in Ubuntu 18.04

Snippets on GeoNode 3.2 Advanced Installation in Ubuntu 18.04 LTS

Installing GeoNode 3.2.* in clean Ubuntu 18.04 using the official documentation results in some errors due to the following issues:

  • Default Python in the OS is Python version 3.6 while version 3.8 is required for GeoNode 3.2
  • The GDAL version available on the OS is 2.2.3 while version 3.3.2 is required. To confirm the above run the follwing commands:
  1. which python to check the existing python version location. It shows the following output.
python: /usr/bin/python3.6 /usr/bin/python3.6m /usr/lib/python3.6 /usr/lib/python3.7 /usr/lib/python2.7 /etc/python3.6  /etc/python2.7 /usr/local/lib/python3.6 /usr/include/python3.6m /usr/share/python
  1. apt-cache policy python-gdal to check available GDAL python bindings version in apt repository. And the output should be as follows.
python-gdal:
  Installed: (none)
  Candidate: 2.2.3+dfsg-2
  Version table:
     2.2.3+dfsg-2 500

Therefore, these conditions have to be met before proceeding with the installation in the official documentation.

  1. Download GDAL version 3.3.2 from the official GDAL download page. wget https://github.com/OSGeo/gdal/releases/download/v3.3.2/gdal-3.3.2.tar.gz
  2. Similarly, download PROJ from PROJ download page since it is a major requirement for GDAL. The version should be 6 or greater. wget https://download.osgeo.org/proj/proj-8.1.1.tar.gz
  3. Download the pre-requisite libraries necessary to build/compile PROJ and GDAL. They include:
  • C compiler
  • C++ compiler
  • SQLIte3 headers, library and executable
  • TIFF development library
  • curl development library with OpenSSL support
  • CMAKE build tools version 3.9 or greater To install the requirements listed above, run the following command in terminal: sudo apt install build-essential gcc g++ sqlite3 libsqlite3-dev libtiff-dev libcurl4-openssl-dev cmake pkg-config
  1. Extract proj archive contents and configure. tar -xf proj-8.1.1.tar.gz && cd proj-8.1.1 && ./configure
  2. Use the following commands to compile and install. make && sudo make install && sudo ldconfig
  3. Similarly, extract and configure GDAL. tar -xf gdal-3.3.2.tar.gz && cd gdal-3.3.2 && ./configure
  4. Build using make and install GDAL. This may take a long while depending on your CPU cores. make && sudo make install && sudo ldconfig Check cores using nproc command and the number that is printed by terminal can be added in the command shown below. For example, if 4 cores present, one can use: make -j4 && sudo make install && sudo ldconfig and so on.
  5. Check if successfully installed using pkg-config --modversion proj for PROJ and pkg-config --modversion gdal or gdalinfo --version for GDAL.
  6. Install Python3.8 using the following command. sudo apt install python3.8 && sudo apt install python3.8-dev
  7. Set python 3.8 as default python by adding the following line in .bashrc file.
alias python='python3.8'
  1. Manually download pip using curl by referring to instructions shown here. sudo apt install curl python3-distutils && sudo apt install python3-testresources && curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
  2. Then install pip for Python3.8 using the following command: source ~/.profile && python3.8 get-pip.py
  3. Check the pip verison. pip3 -V
  4. Finally, install pyGDAL package using pip which should install pygdal version 3.3.2 similar to the gdal version in the OS. pip install "gdal==3.3.2"

From here, one can proceed with the GeoNode advanced installation documentation 18.04

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment