GpxPod 2.0.0: gpxelevations failed

Ubuntu 16.04, Python 2.7.12

According to the Admindoc i’ve installed SRTM.py

sudo pip install SRTM.py
# Use pip3 if you use Python3 by default.
sudo pip3 install SRTM.py

But the check if the gpxelevations script is available failed

gpxelevations -h

  File "/usr/local/bin/gpxelevations", line 46
    print 'Smoothing...'
                       ^
SyntaxError: Missing parentheses in call to 'print'

What does this mean?

Hi,

I think this means that SRTM.py is available with pip3 for Python3 but its code seems to be incompatible with Python3.

Remove it with pip3 and install it with pip :

sudo pip3 uninstall SRTM.py 
sudo pip install SRTM.py

and it should work because it will be called by Python2.x

No idea why the devlopper published it for pip3.

Does it work now ?

No, i don’t think so.

####Uninstall

pip3 uninstall SRTM.py

Uninstalling SRTM.py-0.3.2:
  /usr/local/bin/gpxelevations
  /usr/local/lib/python3.5/dist-packages/SRTM.py-0.3.2.dist-info/DESCRIPTION.rst
  /usr/local/lib/python3.5/dist-packages/SRTM.py-0.3.2.dist-info/INSTALLER
  /usr/local/lib/python3.5/dist-packages/SRTM.py-0.3.2.dist-info/METADATA
  /usr/local/lib/python3.5/dist-packages/SRTM.py-0.3.2.dist-info/RECORD
  /usr/local/lib/python3.5/dist-packages/SRTM.py-0.3.2.dist-info/WHEEL
  /usr/local/lib/python3.5/dist-packages/SRTM.py-0.3.2.dist-info/metadata.json
  /usr/local/lib/python3.5/dist-packages/SRTM.py-0.3.2.dist-info/top_level.txt
  /usr/local/lib/python3.5/dist-packages/srtm/__init__.py
  /usr/local/lib/python3.5/dist-packages/srtm/__pycache__/__init__.cpython-35.pyc
  /usr/local/lib/python3.5/dist-packages/srtm/__pycache__/data.cpython-35.pyc
  /usr/local/lib/python3.5/dist-packages/srtm/__pycache__/main.cpython-35.pyc
  /usr/local/lib/python3.5/dist-packages/srtm/__pycache__/retriever.cpython-35.pyc
  /usr/local/lib/python3.5/dist-packages/srtm/__pycache__/utils.cpython-35.pyc
  /usr/local/lib/python3.5/dist-packages/srtm/data.py
  /usr/local/lib/python3.5/dist-packages/srtm/list.json
  /usr/local/lib/python3.5/dist-packages/srtm/main.py
  /usr/local/lib/python3.5/dist-packages/srtm/retriever.py
  /usr/local/lib/python3.5/dist-packages/srtm/utils.py
Proceed (y/n)? y
  Successfully uninstalled SRTM.py-0.3.2

####Install

pip install SRTM.py

Collecting SRTM.py
Installing collected packages: SRTM.py
Successfully installed SRTM.py-0.3.2

####Check if the gpxelevations script is available
gpxelevations -h

  File "/usr/local/bin/gpxelevations", line 46
    print 'Smoothing...'
                       ^
SyntaxError: Missing parentheses in call to 'print'

####Python version
python --version

Python 2.7.12

After uninstalling and reinstalling SRTM.py, did you launch gpxelevations in a new terminal ?

Normally, Python2.x accepts calls to ‘print’ without parenthesis. I’m quite sure Python3 is called when this problem happens to you. If it still does not work in a new terminal, there is something wrong with your Python versions. If you do this :

python2.7 /usr/local/bin/gpxelevations -h

and it works, it means i’m right and there is a mess with your Python versions…

python2.7 /usr/local/bin/gpxelevations -h

Traceback (most recent call last):
  File "/usr/local/bin/gpxelevations", line 8, in <module>
    import gpxpy as mod_gpxpy
ImportError: No module named gpxpy

python3 /usr/local/bin/gpxelevations -h

  File "/usr/local/bin/gpxelevations", line 46
    print 'Smoothing...'
                       ^
SyntaxError: Missing parentheses in call to 'print'

Step by step, we’re gonna succeed.

Try to install gpxpy with pip :

pip install gpxpy

Then the python2.7 call should work. If it does, you have to find a way to make the direct call work :

gpxelevations -h

Normally, if python2.7 is your default python, it should work.

Then, to make it work when it’s called by GpxPod, the default python version of the webserver user must be 2.7 also. Normally it is.