From: Brian G. <br...@ge...> - 2006-04-15 19:40:41
|
On Apr 15, 2006, at 3:31 AM, Marco Linux wrote: > I'm using playerstage and want to use the python bindings. > when i install player-2.0.1 and stage-2.0.1 they work fine, but i > get an > import error in python. > both on my laptop(debian) and on my home pc(gentoo). > > Python 2.4.2 (#1, Dec 13 2005, 22:32:56) > [GCC 3.3.3 20040412 (Gentoo Linux 3.3.3-r6, ssp-3.3.2-2, > pie-8.7.6)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. >>>> import playerc > Traceback (most recent call last): > File "<stdin>", line 1, in ? > File "/home/marco/robotica/ps2//lib/python2.4/site-packages/ > playerc.py", > line 5, in ? > import _playerc > ImportError: /home/marco/robotica/ps2/lib/python2.4/site-packages/ > _playerc.so: > undefined symbol: playerc_simulation_set_property_string >>>> I can replicate the problem on my Ubuntu machine. Turns out that playerc_simulation_set_property_string and playerc_simulation_set_property_double are prototyped in playerc.h but not implemented. I've fixed that by adding dummy implementations; a patch against player-2.0.1 is attached. Unfortunately, I now get the following error when importing playerc: File "/home/gerkey/ps-2.0/lib/python2.4/site-packages/playerc.py", line 5168, in player_simulation_property_int_req_t if _newclass:value = property (_playerc.player_simulation_property_int_req_t_value_get, _playerc.player_simulation_property_int_req_t_value_set) TypeError: 'property' object is not callable It seems that the field 'property' in the structure player_simulation_property_int_req_t is confusing Python, in which 'property' is a type. SWIG's auto-generated Python code is creating a local variable called 'property,' which makes the subsequent cast to the type 'property' fail. Anybody know how to get around this (besides changing the name of the field in the structure)? brian. |