Install

Prerequisites

Python: >=3.9, <3.14
Operating System: Linux, Windows, MacOS

All gnss_lib_py classes and methods are tested in Python 3.9, 3.10, 3.11, 3.12, and 3.13 in the latest Ubuntu, MacOS and Windows versions. Python 3.9 will soon be deprecated, please consider updating to a newer version of Python. gnss_lib_py was originally developed in Python 3.8.9 in Ubuntu 20/22 and Ubuntu 20 for WSL2.

Use on Google Colab

colab

We provide support to run gnss_lib_py on Google Colab. To run on Google Colab, use the following command to install gnss_lib_py:

%pip install gnss-lib-py --quiet --progress-bar off

To include gnss_lib_py in the Google Colab environment, use the following command

import gnss_lib_py as glp

To use gnss_lib_py from a specific branch, use the following code block to clone gnss_lib_py, checkout the desired branch, and install:

import os
os.makedirs("/content/lib", exist_ok=True)
%cd /content/lib
!pip install --upgrade pip --quiet --progress-bar off
!git clone https://github.com/Stanford-NavLab/gnss_lib_py.git --quiet
%cd gnss_lib_py
!git checkout desired-branch-name-here CHANGE TO DESIRED BRANCH
!git pull
!pip install -e . --quiet --progress-bar off

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.9.0 or above with pyenv. For example, pyenv install 3.9.19.

  3. Clone the gnss_lib_py repository.

  4. Inside the gnss_lib_py run pyenv local 3.9.19 (switching out with the version of Python you installed in the previous step if different than 3.9.19) 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.