Installing GPSTk in Anaconda Python
GPSTk 2.10 Python examples require installing GPSTk for Python. GPSTk 2.10 requires Python 2.7.
Install GPSTk for Python
- Use Anaconda to switch to Python 2.7 by
conda create -n py27 python=2.7 conda activate py27 conda install matplotlib
- install minimal prereqs
apt install g++ make cmake swig
- Download gpstk source
git clone --depth 1 https://github.com/SGL-UT/GPSTk cd GPSTk
- Build & install. This takes several minutes, and emits a very large number of C++11 deprecation warnings
./build.sh -ue
Test GPSTk Python
- get the example code
git clone https://github.com/scivision/gpstk-examples-python
- try the examples like:
./example1.py
Notes
If you get an error like
CMake Error at swig/PythonSetup.cmake:45 (string): string sub-command REGEX, mode MATCH needs at least 5 arguments total to command.
Create a file GPSTk/swig/CustomPythonSetup.cmake with contents (assuming python in ~/anaconda2)
set( PYTHONLIBS_FOUND "TRUE" )
set( PYTHON_LIBRARIES
"$ENV{HOME}/anaconda2/lib/libpython2.7.so"
CACHE FILEPATH "File Path to system python shared object library" )
set( PYTHON_INCLUDE_DIRS
"$ENV{HOME}/anaconda2/include/python2.7"
CACHE PATH "Directory Path to system python includes" )
Tags: gnss
Categories: python