TypeError: gobject `OsmGpsMap' doesn't support property `user_agent'

106 views
Skip to first unread message

Mark Snidal

unread,
Mar 28, 2016, 7:52:36 AM3/28/16
to osm-gps-map
Hello all,

I was looking for a simple GTK+ GPS map widget with Python bindings and this project looked like a great fit. I installed osm-gps-map from the Arch community repos (https://www.archlinux.org/packages/community/x86_64/osm-gps-map/) and tried to run the example code in the GitHub (mapviewer.py) using Python2.7, PyGTK version (2, 24, 0) and GTK version (2, 24, 30), and it produced these warnings/errors:

mapviewer.py:24: PyGIWarning: Gtk was imported without specifying a version first. Use gi.require_version('Gtk', '3.0') before import to ensure that the right version gets loaded.
 
from gi.repository import Gtk
mapviewer
.py:32: PyGIWarning: OsmGpsMap was imported without specifying a version first. Use gi.require_version('OsmGpsMap', '1.0') before import to ensure that the right version gets loaded.
 
from gi.repository import OsmGpsMap as osmgpsmap
using library: <gi.repository.OsmGpsMap> (version 1.0)
Traceback (most recent call last):
 
File "mapviewer.py", line 278, in <module>
    u
= UI()
 
File "mapviewer.py", line 73, in __init__
   
self.osm = osmgpsmap.Map(user_agent="mapviewer.py/%s" % osmgpsmap._version)

Has anybody encountered this issue before? It seems like the Python bindings might not have installed properly on my machine, but when I tried to build from source, it seemed the instructions on your website were out of date regarding the Python bindings (ie. there is no /python folder in the source anymore.)

Cheers,
Mark

Patrick Salecker

unread,
Mar 28, 2016, 9:36:21 AM3/28/16
to osm-gps-map
Hi,
the example in GitHub repository contains changes that aren't compatible with osm-gps-map 1.1.0 that comes with archlinux.

Please try an older revision of the mapviewer.py:
https://github.com/nzjrs/osm-gps-map/blob/c1983d823b6b01aefb9d4af728e3cac4d32466ef/examples/mapviewer.py

Best regards,
Patrick

peter....@gmail.com

unread,
Aug 9, 2019, 3:50:43 AM8/9/19
to osm-gps-map
I had the very same problem on Ubuntu 18.04.3 LTS (Bionic).

The forward-incompatible change in mapviewer.py is just a single line: (mapviewer.py:73)

-            self.osm = osmgpsmap.Map(user_agent="mapviewer.py/%s" % osmgpsmap._version)                                                                                  
+            self.osm = osmgpsmap.Map()

As a side note, the install instructions on the website are outdated for current Ubuntu. I had to install "libosmgpsmap-1.0-1" and "gir1.2-osmgpsmap-1.0" for the example to work:

$ sudo apt-get install libosmgpsmap-1.0-1 gir1.2-osmgpsmap-1.0

Can we update the instructions on the website accordingly? Unfortunately, I couldn't find the related code in the gh-pages branch of the repository. Any hints?

Peter

peter....@gmail.com

unread,
Aug 9, 2019, 4:41:20 AM8/9/19
to osm-gps-map
I found the website source code and opened a pull request:


Cheers!
Reply all
Reply to author
Forward
0 new messages