All Collections
WEkEO Trainings & Webinars
How to install xcube on Ubuntu?
How to install xcube on Ubuntu?

You want to install xcube to manipulate your data? This article is for you!

Alexandre avatar
Written by Alexandre
Updated over a week ago

Context


The xcube software package was created for the purpose of producing, altering, examining, and sharing datacubes derived from Earth observation data. This guide aims to describe the procedure for installing and configuring xcube (and its applications) on Ubuntu 20.04.

Install xcube on Ubuntu from script


Set up a conda environment

There are several methods to install xcube, the main ones being conda and mamba. Since conda could be extremely slow, mamba is generally preferred. Mamba is a dramatically faster drop-in replacement for conda and can be installed using conda itself.


The first step consists in updating the local apt package index:

>>sudo apt-get update -y

Next, create a miniconda3 directory:

>>mkdir -p ~/miniconda3

Download bash script to install conda with wget. After, execute the bash script:

>>wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda3/miniconda.sh
>>bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3

And add the following PATH variable:

>>export PATH=$PATH:/root/miniconda3/bin

Initialize conda:

>>~/miniconda3/bin/conda init bash
>>~/miniconda3/bin/conda init zsh

Once Miniconda is installed, use the conda command to create a conda environment called xcube_env and install Python (>=3.9):

>>. ./miniconda3/etc/profile.d/conda.sh
>>conda create -n xcube_env python=3.9 -y

When the environment is installed, the following command is used to activate it:

>>conda activate xcube_env

Use conda to install mamba:

>>conda install -c conda-forge mamba -y

Install xcube into the environment

Finally, it is possible to install xcube from its conda-forge package. Starting from version 1 of xcube, the xcube installation automatically installs all plugins, such as the xcube viewer:

>>mamba install -c conda-forge xcube=1.2.0 proj=9.1.0 pyproj=3.4.1 -y 

After xcube is successfully installed, you can use the package to create and visualize data cubes from Earth observation data. Examples on how to generate datacubes with xcube can be found here.

πŸ” You will find some examples in our article How to use xcube Viewer? and also more examples will soon follow on the Jupyter Catalogue.

What's next?


Feel free to check these articles that might be of interest for you:

If you have any question or feedback, feel free to contact us:

  • through a chat session available in the bottom right corner of the page

  • via e-mail to our support team (supportATwekeo.eu)

Did this answer your question?