SparkFun GPS-RTK Dead Reckoning ZED-F9R Hookup Guide

Pages
Contributors: bboyho, Elias The Sparkiest
Favorited Favorite 4

U-Blox Python Package

Python Versions and Installing PIP

There are also 2 commonly used Python versions. Even after Python 3 came out many people continued to use 2.7 for many years. Part of the reason is that Python 3 improved on some things and in the process made it not backwards compatible. We recommend using Python 3 since Python 2 has reached its end of life. To see what version of Python your Pi is using, open a command line and type each of the following commands individually to check.

language:bash
python --version
pip --version

If you are not using Python 3, then we'll need to open the *.bashrc file and add an alias.

First, you will need to update the python installation package by running the following command to install pip for Python 3. Execute the following commands.

language:bash
sudo apt-get install python3-pip

Type the following command to open the file.

language:bash
nano ~/.bashrc

Then add the following lines at the end. That should tell the computer whenever you want to run python to look for the file located at /usr/bin/python3.

language:bash
alias python='/usr/bin/python3'
alias pip=pip3

Alias Python 3 and pip3

To exit nano type CTRL + X and then hit Y when it asks you if you want to save and then ENTER. You can now either reboot or type the following to force the Pi to run the *.bashrc file again.

language:bash
source ~/.bashrc

Once adjusted, type the following command to ensure that pip is up to date.

language:bash
python -m pip install --upgrade pip

Qwiic Python Package

We will also need to install the Qwiic Python libraries. This will automatically download a folder containing all the Qwiic_Py files and dependencies to your Raspberry Pi. Run the following command to automatically install the modules for SparkFun devices. Note that while the u-Blox Python package is included in the Qwiic_Py, the pHAT uses the hardware UART instead of I2C bus. To ensure that you are installing to the correct path for Python 3, make sure that you use pip3.

language:bash
sudo pip3 install sparkfun-qwiic