Install

Prerequisites

Python: >=3.8, <3.12
Operating System: Linux, Windows, MacOS

All gnss_lib_py classes and methods are tested in Python 3.8, and 3.11 in the latest Ubuntu, MacOS and Windows versions. gnss_lib_py was originally developed in Python 3.8.9 in Ubuntu 20/22 and Ubuntu 20 for WSL2.

Standard Installation

  1. gnss_lib_py is available through pip installation with:

    pip install gnss-lib-py
    

Editable Installation

  1. Clone the GitHub repository:

    git clone https://github.com/Stanford-NavLab/gnss_lib_py.git
    
  2. Install dependencies with pip:

    pip3 install -r requirements.txt
    
  3. Update pip version.

    1. For Linux and MacOS:

      pip install -U pip
      
    2. For Windows:

      python -m pip install -U pip
      
  4. Install gnss_lib_py locally from directory containing pyproject.toml

    pip install -e .
    
  5. Verify installation by running pytest. A successful installation will be indicated by all tests passing.

    pytest
    

Developer Installation

This project is being developed using pyenv and poetry for python version and environment control respectively.

Linux/WSL2 and MacOS

  1. Install pyenv using the installation instructions here. The steps are briefly summarized below:

    1. Install the Python build dependencies.

    2. Either use the automatic installer or the Basic GitHub Checkout.

    3. In either case, you will need to configure your shell’s environment variables for pyenv as indicated in the install instructions. For example, for bash, you can add the following lines to the end of your .bashrc

      export PATH="$HOME/.pyenv/bin:$PATH"
      eval "$(pyenv init --path)"
      eval "$(pyenv virtualenv-init -)"
      
  2. Install Python 3.8.9 or above with pyenv. For example, pyenv install 3.8.9.

  3. Clone the gnss_lib_py repository.

  4. Inside the gnss_lib_py run pyenv local 3.8.9 (switching out with the version of Python you installed in the previous step if different than 3.8.9) to set the Python version that code in the repository will run.

  5. Install poetry>=1.2 using the instructions here.

  6. Install Python dependencies using poetry install.

  1. Install pandoc to be able to build documentation. See details here.

    1. For Linux sudo apt install pandoc

    2. For Windows choco install pandoc

    3. For MacOS brew install pandoc

  2. Verify that the code is working by running tests on the code using

    poetry run pytest
    

    Check the Testing section in the Contribution guide for more details

  3. Verify that the documentation is building locally using

    ./build_docs.sh
    

Windows

  1. Currently, full support is not offered for Windows, but pyenv can be installed following instructions here.

  2. The workflow for installing poetry and gnss_lib_py is similar once pyenv has been set up.

Refer to the Documentation section once you add code/documentation and want to build and view the documentation locally.