Skip to main content
`Ctrl`+`K`

# Installing tracklib

## Installing tracklib for development

### Tracklib developer mode

1. You may install the latest development version by cloning the GitLab repository:

    git clone https://github.com/umrlastig/tracklib.git
    cd tracklib

2. Then you can create a new environment:

    [sudo apt-get install python3-venv]
    python3 -m venv tracklibenv
    source tracklibenv/bin/activate

3. You have to install required dependencies:

    pip install --upgrade pip
    pip install wheel
    pip install setuptools
    pip install twine

4. You may using pip to install tracklib from the local directory

    pip install -e .
    python setup.py install

5. Later, if you want to quit

    deactivate

### Running test

5 If you want to run unit tests, you have to install these dependencies:

    pip install pytest
    pip install pytest-runner
    pip install pytest-benchmark
    pip install coverage

### Running documentation

6. If you want to generate the documentation, you have to install some dependencies are required:

    pip install sphinx
    pip install recommonmark
    pip install sphinx_rtd_theme
    pip install sphinx-autodoc-typehints

7. To launch the documentation:

    cd doc
    make html

### Spyder IDE

8. A python IDE make the development more easy.

    pip install spyder
    pip install spyder-kernels
    spyder &

To use spyder, you have to create a new project with an existing directory.

Figure 1 - Tracklib project in Spyder

### Run tracklib as an 3rd party python library for QGIS

1. Check in the QGIS Python Console with which version of python, Qgis runs. To find out where:

    import sys
    sys.executable

    >> '/usr/bin/python3'

2. Then install dependencies in linux console:

    /usr/bin/python3 -m pip install -r /home/glagaffe/tracklib/requirements.txt

3. At the end, add tracklib to the python system path:

    sys.path.append('/home/glagaffe/tracklib')

## Installing tracklib for using in python script

tracklib is written in pure Python, so installation is easy. tracklib works on Python 3.5+.

### Installing from the Python Package Index

You can download it from PyPI repository using pip:

    TODO