Skip to content

Basic Installation Guide

Installation Instructions

We recommend that you use Windows 10, Windows 11, or Ubuntu Linux. Mac users, please see Mac install guide

In order to use Coastseg you need to install Python packages in an environment. We recommend you use Miniforge to install the python packages in an environment for Coastseg.

After you install Anaconda/miniforge on your PC (see our How to Install Miniforge), open the Anaconda Prompt/Miniforge Prompt in Windows or Terminal in Mac and Linux. Then use the cd command (change directory) to go the folder where you have downloaded the Coastseg repository.

We highly recommend you install CoastSeg using conda following the instructions in Install from conda-forge.

Step 1: Install CoastSeg from Github

  1. Make sure you have git installed and if not please download it here
    • This install git as well as git bash on your computer
  2. Open a terminal (or if you are on windows open git bash) and run the command

    1
    git --version
    
    • It should return something like this if you have it git installed
    1
    2
    git --version
    git version 2.47.0.windows.1
    
  3. Open a terminal that has git installed, then use the cd command ( change directory) to switch the location you want to install CoastSeg

  4. Then use the git clone https://github.com/SatelliteShorelines/CoastSeg.git --depth 1 to install the code from github
  5. Once the git clone command finishes use the cd command ( change directory) to switch the CoastSeg directory containing the code you installed.
1
2
3
 cd path/to/your/directory 
 git clone https://github.com/SatelliteShorelines/CoastSeg.git --depth 1
 cd CoastSeg

0. Install MiniForge/Anaconda

To get started, you'll need to install MiniForge, which is a free and open-source distribution of Python and R that comes with essential packages and tools for scientific computing and data science.

Follow our guide here: How to Install Miniforge

Note: CoastSeg will work in Anaconda, however since not all users can use Anaconda due to the EULA we provide only provide installation instructions for Miniforge.

1.Create an Conda Environment and Activate it

  • This command creates an anaconda environment named coastseg and installs python 3.10 in it.
1
2
conda create --name coastseg python=3.10 -y
conda activate coastseg

install conda in miniforge

2.Install coastseg

1
conda install -c conda-forge coastseg

install coastseg from conda forge

3.(Optional) Install Optional Dependencies

  • Only install these dependencies if you plan to use CoastSeg's Zoo workflow notebook.
  • Warning installing tensorflow will not work correctly on Mac see for more details Mac install guide
1
2
3
pip install tensorflow==2.16.2
pip install transformers
pip install tf-keras==2.16

Method #2: Install from Pypi

1.Create an miniconda/Anaconda environment

  • This command creates an anaconda environment named coastseg and installs python 3.10 in it.
    1
    conda create --name coastseg python=3.10 -y
    

2.Activate your conda environment

1
conda activate coastseg
  • If you have successfully activated coastseg you should see that your terminal's command line prompt should now start with (coastseg).

coastseg activated in anaconda prompt

3.Install the CoastSeg from PyPi

1
pip install coastseg

4.Install GDAL from conda-forge

  • CoastSeg requires gdal to function properly and requires it to be installed from conda-forge due to how it is configured in the conda environment.
  • Make sure to install gdal from the conda-forge channel to ensure you get the latest version and to avoid dependency conflicts.
1
conda install -c conda-forge  gdal -y

5.(Optional) Install Optional Dependencies for the Zoo Workflow

  • Only install these dependencies if you plan to use CoastSeg's Zoo workflow notebook.
  • Warning installing tensorflow will not work correctly on Mac see for more details Mac install guide
1
2
3
pip install tensorflow==2.16.2
pip install transformers
pip install tf-keras==2.16
  • If you get any errors about numpy try running pip install numpy<2

Having Installation Errors?

Use the command conda clean --all to clean old packages from your anaconda base environment. Ensure you are not in your coastseg environment or any other environment by running conda deactivate, to deactivate any environment you're in before running conda clean --all. It is recommended that you have Anaconda prompt (terminal for Mac and Linux) open as an administrator before you attempt to install coastseg again.