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:
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
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.
- 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
- 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
- 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
- Extract proj archive contents and configure.
tar -xf proj-8.1.1.tar.gz && cd proj-8.1.1 && ./configure
- Use the following commands to compile and install.
make && sudo make install && sudo ldconfig
- Similarly, extract and configure GDAL.
tar -xf gdal-3.3.2.tar.gz && cd gdal-3.3.2 && ./configure
- 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 usingnproc
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. - Check if successfully installed using
pkg-config --modversion proj
for PROJ andpkg-config --modversion gdal
orgdalinfo --version
for GDAL. - Install Python3.8 using the following command.
sudo apt install python3.8 && sudo apt install python3.8-dev
- Set python 3.8 as default python by adding the following line in
.bashrc
file.
alias python='python3.8'
- 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
- Then install pip for Python3.8 using the following command:
source ~/.profile && python3.8 get-pip.py
- Check the pip verison.
pip3 -V
- 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