Install watershed-workflow on a fresh Ubuntu 22.04 LTS (without ATS installation)
Published:
Notes:
- Last updated: Nov. 2024
Install Ubuntu on WSL
- Go to Microsoft Store
- Search Ubuntu 22 and Download
- After successfully installed, create a new user in Ubuntu
- Log in Ubuntu using that newly created user account
Install essential packages:
sudo apt update && sudo apt upgrade -y && sudo apt autoremove -y
sudo apt install vim curl git make cmake
Install miniconda and Python packages:
- Download and install miniconda:
curl https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -o miniconda.sh
bash miniconda.sh
- After miniconda successfully installed, restart terminal.
note: If in WSL, running
wsl --shutdown
in Windows command prompt is required because of the CondaHTTPError github.com/conda/conda/issues/9948.
Set up Python environment
- Install libmamba to make conda faster.
conda update -n base conda
conda install -n base conda-libmamba-solver
conda config --set solver libmamba
- Create a new environment called
watershed_workflow
.
conda create -n watershed_workflow -c conda-forge -c defaults python=3 numpy matplotlib scipy pandas geopandas ipython ipykernel jupyterlab nb_conda_kernels meshpy fiona rasterio shapely=1.8.4 cartopy pyepsg descartes pyproj requests sortedcontainers attrs pytest netcdf4 h5py tqdm libarchive
conda activate watershed_workflow
note: It may require 30 min to a few hours to solve the environment.
- Check if successfully set up:
python -c 'import numpy, matplotlib, scipy, rasterio, fiona, shapely, cartopy, meshpy.triangle; print("SUCCESS")'
Download SEACAS
cd
git clone https://github.com/sandialabs/seacas.git
Install Exodus (a part of SEACAS)
(See sandialabs.github.io/seacas-docs/sphinx/html/ for SEACAS and Exodus details)
cd seacas && export ACCESS=`pwd`
MPI=YES ./install-tpl.sh
mkdir build
cd build
../cmake-exodus
make && make install
note: Replace
../cmake-exodus
with../cmake-config
if try to install full SEACAS
- Test if Exodus successfully installed:
export PYTHONPATH=${ACCESS}/lib; python -c 'import exodus; print("SUCCESS")'
Download and install watershed-workflow
cd
git clone https://github.com/environmental-modeling-workflows/watershed-workflow.git
cd watershed-workflow
python -m pip install -e .
- Edit
.bashrc
to export PYTHONPATH:
cd
vi .bashrc
Append the following line to .bashrc
:
export PYTHONPATH="$HOME/watershed-workflow/bin:$HOME/seacas/lib"
Now restart terminal, or:
source .bashrc
- (optional) Test if watershed-workflow successfully installed:
cd watershed-workflow
pytest watershed_workflow/test