Install
Prerequisites
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
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
gnss_lib_pyis available throughpipinstallation with:pip install gnss-lib-py
Editable Installation
Clone the GitHub repository:
git clone https://github.com/Stanford-NavLab/gnss_lib_py.git
Install dependencies with pip:
pip3 install -r requirements.txt
Update pip version.
For Linux and MacOS:
pip install -U pip
For Windows:
python -m pip install -U pip
Install
gnss_lib_pylocally from directory containingpyproject.tomlpip install -e .
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
Install
pyenvusing the installation instructions here. The steps are briefly summarized below:Install the Python build dependencies.
Either use the automatic installer or the Basic GitHub Checkout.
In either case, you will need to configure your shell’s environment variables for
pyenvas indicated in the install instructions. For example, forbash, you can add the following lines to the end of your.bashrcexport PATH="$HOME/.pyenv/bin:$PATH" eval "$(pyenv init --path)" eval "$(pyenv virtualenv-init -)"
Install Python 3.9.0 or above with
pyenv. For example,pyenv install 3.9.19.Clone the
gnss_lib_pyrepository.Inside the
gnss_lib_pyrunpyenv 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.Install
poetry>=1.2using the instructions here.Install Python dependencies using
poetry install.
Install pandoc to be able to build documentation. See details here.
For Linux
sudo apt install pandocFor Windows
choco install pandocFor MacOS
brew install pandoc
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
Verify that the documentation is building locally using
./build_docs.sh
Windows
Currently, full support is not offered for Windows, but
pyenvcan be installed following instructions here.The workflow for installing
poetryandgnss_lib_pyis similar oncepyenvhas been set up.
Refer to the Documentation section once you add code/documentation and want to build and view the documentation locally.