Python#
Usage#
SEPAL instances run on focal
ubuntu machines and thus provide a fully functional Pyhton 3.8
environment. This environment is accecible through Jupyter Notebook, JupyterLab or the terminal:



Description#
The SEPAL python environment is not empty and embed numerous librairies. They are listed here:
# version 2022-11-24
######## geospatial data analysis ########
scikit-image
scipy
shapely
shapely-geojson
tqdm
xarray-leaflet
GDAL==$GDAL_VERSION
bqplot
numpy==$NUMPY_VERSION
geopandas
matplotlib
pandas
dask[complete]
planet
tensorflow-probability
geeadd
######## Google Earthengine ########
oauth2client
google-api-python-client==1.12.8
git+https://github.com/openforis/earthengine-api.git@v0.1.343#egg=earthengine-api&subdirectory=python
oeel
######## BFAST dependencies ########
wget
Sphinx==2.2.0
sphinx-bootstrap-theme==0.7.1
numpydoc
git+https://github.com/12rambau/bfast.git
######## sepal modules ########
geemap
Unidecode
pyperclip
python-dateutil
pytesmo
Wand
PyPDF2 # more recent version are avaiable (PyPDF4)
rasterio
openpyxl
pre-commit
ipywidgets==7.6.5
ipyvuetify==1.8.2
######## web api ########
falcon
gunicorn
pyCrypto
awscli
######## other deps ########
xarray
dask
dask-geopandas
nrt
seaborn
requests
llvmlite
coverage
######## OSK requirements ########
descartes
fiona
godale
psycopg2-binary
imageio
rtree
retrying
Cython
pyproj==2.6.1 # Require proj update before 3.0.0 can be installed
######## Early Warning System for Canopy Disturbances in Ecuador (SATA) ########
nose
nosexcover
pylint
click
dateutils
boto3
Run pip show <name of your lib>
to check if it’s already installed.
Customization#
The SEPAL environment can be customized to user needs using any third-party librairies and pip. By default installation will be run in --user
mode and won’t affect other SEPAL users.

Note
If you face compatibility issues when customizing your SEPAL environment, please let us know in the Github issue tracker.
Virtual environment#
Warning
SEPAL does not support conda environments, if you need to install compiled librairies, please the SEPAL team via the Github issue tracker.
SEPAL supports python venv creation. in this section we’ll explain how you can create a venv and link it to Jupyter so you can run your processes on the associated kernel.
By design Jupyter is runnnig on the Python Kernel described in the previous section. you can also use the kernel associated to our applications (they start with venv
). If your work rely on very specific version numbers it might be good to run everything on a dedicated environment.
If not existing, create a directory to host your virtual environments. From the root directory, run the following line:
folder_name="my_virtual_env" # Replace my_virtual_env with the name you want to give to the folder that will hold your virtual environment
And then, copy and paste the following lines in your terminal:
mkdir -p "$folder_name" # Create your folder (included partents if are given).
python3 -m venv "$folder_name" # Create the venv, this line could take some time.
source "$folder_name/bin/activate" # Activate the virtual enviroment just created.
pip install ipykernel # Install ipykernel in our venv.
python -m ipykernel install --user --name="$folder_name" --display-name="(venv) - $folder_name" # Add the new venv kernel to jupyter.
deactivate # (optional) exit from environment.
Now this venv will be available as a kernel inside your Jupyter workspace. This kernel will be automatically removed if you destroy the venv directory.
Note that If you want to install libs inside this venv you need first to activate it:
source your_venv_path/bin/activate