Skip to content

Regular users on Windows and Linux

Please refer to the installation guide on the README

Mac users

CoastSeg requires Tensorflow (TF), which doesn't play nicely with Mac. Please see Mac install guide for more details.

Users working over secure network

First, some notes:

  • ⚠️ The CoastSeg team is aware of issues with installing CoastSeg's conda dependencies⚠️
  • ⚠️The following instructions are valid as of 2023-09-12. If this proposed solution fails for you, please create a new Issue ⚠️
  • ⚠️ Where possible, we advise you install the initial Coastseg conda environment not over a secure network. If and ONLY if that is not possible, please follow the instructions posted below carefully
  • If you are running these commands on a secure network verify you are connected to your VPN before running the following commands
  • if you get an SSL error while running any of the conda install commands try the following command
  • ONLY RUN THE PIP INSTALL COMMANDS AFTER CREATING A PIP.INI file Go to Phase 1: Create a pip.ini File

Quick Start

Second, you must temporarily (for a few minutes) disable SSL verification. This should be done only once, when setting up the initial conda environment. If you find yourself having to do this for other instructions listed below and elsewhere, something is wrong and you should either start again from scratch, or raise an Issue if there is a legitimate bug. Coastseg developers are not liable for any unintended effects of ignoring the advice posted here, i.e. leaving ssl_verify to be False outside of the specific and unique case explained here.

1
conda config --set ssl_verify False

Now, you can install the rest of the dependencies. You must do this immediately.

1
2
3
4
conda install -c conda-forge geopandas jupyterlab -y
pip install coastseg
pip uninstall h5py -y
conda install -c conda-forge h5py -y

Finally, re-enable SSL verification. You must do this immediately after installing the conda packages above. If any of the above commands fail for whatever reason, you must also run this command to re-enable SSL. Coastseg developers are not liable for any unintended effects of ignoring the advice posted here, i.e. leaving ssl_verify to be False outside of the specific and unique case explained here.

1
conda config --set ssl_verify True

Detailed Guide

Phase 0: Allow Git to work over a secure network

  1. Configure git to use ssl

  2. Make sure to replace "C:/Users/ulastname/Documents/DOIRootCA2.cer" with your user name

1
git config --global http.sslcainfo "C:/Users/ulastname/Documents/DOIRootCA2.cer"
  1. Test if this worked

  2. This step assumes you have a github account and are in the CoastSeg directory

1
git pull origin main

Phase 1: Allow Pip to work over a secure network

  1. Open the pip.ini file
  2. In anaconda prompt or the command line run:
    1
    notepad %APPDATA%\pip\pip.ini
    
  3. Edit the pip.ini file
  4. Make sure to replace C:\Users\ulastname\Documents\cacert_with_doi.pem`
  5. save and exit after editing
    1
    2
     [global]
     cert = C:\Users\ulastname\Documents\cacert_with_doi.pem
    
  6. Check the contents of the pip.ini
    1
     pip config list
    
  7. it should return something like
    1
     global.cert='C:\\Users\\ulastname\\Documents\\cacert_with_doi.pem'
    
  8. Test if pip is configured correctly

Run the command :

1
pip -v list

If you get no errors then you are done! 🎊

Did you get errors? If so, run the following command:

1
pip --cert  C:\\Users\\ulastname\\Documents\\cacert_with_doi.pem -v list
  • Verify you are connected to your VPN because this command will fail if you are not
  • If this command fails it might double check the correct location of the cert file is listed in your command
What to do if pip fails

  1. Error Message contains the phrase 'Open SSL Module is not available'

    1
    Can't connect to HTTPS URL because the SSL module is not available
    
  2. Solution: Copy the following files from CONDA_PATH\Library\bin to CONDA_PATH\DLLs

1
2
libcrypto-1_1-x64.*
libssl-1_1-x64.*
  • Make sure to copy libcrypto-1_1-x64.* and libssl-1_1-x64.* to CONDA_PATH\DLLs
  • CONDA_PATH is just the path to your anaconda installation
  • Example : CONDA_PATH : C:\Users\sfitzpatrick\Anaconda3
  • Example : CONDA_PATH\Library\bin: C:\Users\sfitzpatrick\Anaconda3\Library\bin
  • Example : CONDA_PATH\DLLs: C:\Users\sfitzpatrick\Anaconda3\DLLs
  • Original Credit for this solution

Phase 2: Allow Conda to Work Over a Secure Network

  1. Run the command
1
conda config --set ssl_verify C:\Users\uname\Documents\cacert_with_doi.pem
  1. Verify it worked
1
conda config --show ssl_verify
  • It should return something like
1
2
(coastseg) C:\Users\uname>conda config --show ssl_verify
ssl_verify: C:\Users\uname\Documents\cacert_with_doi.pem
Optional Step (only if you get ssl errors with git)
  1. Make a .gitconfig file

  2. Example location: c:\Users\me\.gitconfig

  3. Make sure to replace C:/Users/uname/Documents/DOIRootCA2.cer with your username
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
[filter "lfs"]
    clean = git-lfs clean -- %f
    smudge = git-lfs smudge -- %f
    process = git-lfs filter-process
    required = true
[user]
    name = Sharon Fitzpatrick
    email = SF2309@Gmail.Com
[http]
    sslbackend = schannel
    sslVerify = true
    sslcainfo = C:/Users/uname/Documents/DOIRootCA2.cer

Phase 3: Install CoastSeg Normally

Now that pip is working, follow the rest of the installation instructions located at Basic Install Guide

Step 2: Configure CoastSeg for a Secure Network

To use coastseg on a secure network you need to add the location of the certification file for your network in the certifications.json file.

1.Open the certifications.json file

This file is located in the main CoastSeg directory

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
├── CoastSeg
│   ├── src
│   |  |_ coastseg
│   |  |  |_ __init__.py
│   |  |  |_bbox.py
│   |  |  |_roi.py
|
|___data
|    |_ <data downloaded here> # automatically created by coastseg when imagery is downloaded
|
|
|___certifications.json  *This is the file you need to modify*

cert_path_screenshot

2.Modify cert_path to have the full path to your cert file.

  • Windows Users: Make sure to replace each \ with \\

Here is an example of the full path to a cert file.

full_cert_path_ing

3.That's it. You're done! 🎊

WSL SetUp Over a Secure Network

If you are using WSL to run coastseg you will need to install coastseg to your WSL instance that's because coastseg downloads files to where its installed and if its not running where it was installed it will fail to find of your data.

Run these commands each time you open WSL

  • Make sure to replace "mnt/c/users/uname/documents/cacert_with_doi.pem" with your user name
1
2
3
export PIP_CERT=mnt/c/users/uname/documents/cacert_with_doi.pem
export SSL_CERT_FILE=mnt/c/users/uname/documents/cacert_with_doi.pem
export REQUESTS_CA_BUNDLE=mnt/c/users/uname/documents/cacert_with_doi.pem

Run these commands in WSL once

  • Make sure to replace uname with your username mnt/c/users/uname/documents/cacert_with_doi.pem and verify you have cacert_with_doi.pem installed in that location.
  • Make sure to replace "mnt/c/users/uname/documents/cacert_with_doi.pem" with your user name
1
2
conda config --set ssl_verify mnt/c/users/uname/documents/cacert_with_doi.pem
git config --global http.sslCAInfo mnt/c/users/uname/documents/DOIRootCA2.cer