Python Wrapper on Ubuntu 10.10 Problems

258 views
Skip to first unread message

Derekioh

unread,
Jan 11, 2011, 1:09:54 PM1/11/11
to OpenKinect
So I've quite literally spent a good 7 hours finding out how to get
the python wrapper working for ubuntu 10.10, but it's just not
building. I'm getting the error:

Error converting Pyrex file to C:
------------------------------------------------------------
...
cdef freenect_raw_tilt_state* _ptr
def __repr__(self):
return "<State Pointer>"

def _get_accelx(self):
return
int(cython.operator.dereference(self._ptr).accelerometer_x)
^
------------------------------------------------------------

/home/derekjr-laptop/libfreenect/wrappers/python/freenect.pyx:112:25:
'operator' not a valid cython attribute or is being used incorrectly

Error converting Pyrex file to C:
------------------------------------------------------------
...

def _get_accelx(self):
return
int(cython.operator.dereference(self._ptr).accelerometer_x)

def _get_accely(self):
return
int(cython.operator.dereference(self._ptr).accelerometer_y)
^
------------------------------------------------------------

/home/derekjr-laptop/libfreenect/wrappers/python/freenect.pyx:115:25:
'operator' not a valid cython attribute or is being used incorrectly

Error converting Pyrex file to C:
------------------------------------------------------------
...

def _get_accely(self):
return
int(cython.operator.dereference(self._ptr).accelerometer_y)

def _get_accelz(self):
return
int(cython.operator.dereference(self._ptr).accelerometer_z)
^
------------------------------------------------------------

/home/derekjr-laptop/libfreenect/wrappers/python/freenect.pyx:118:25:
'operator' not a valid cython attribute or is being used incorrectly

Error converting Pyrex file to C:
------------------------------------------------------------
...

def _get_accelz(self):
return
int(cython.operator.dereference(self._ptr).accelerometer_z)

def _get_tilt_angle(self):
return int(cython.operator.dereference(self._ptr).tilt_angle)
^
------------------------------------------------------------

/home/derekjr-laptop/libfreenect/wrappers/python/freenect.pyx:121:25:
'operator' not a valid cython attribute or is being used incorrectly

Error converting Pyrex file to C:
------------------------------------------------------------
...

def _get_tilt_angle(self):
return int(cython.operator.dereference(self._ptr).tilt_angle)

def _get_tilt_status(self):
return int(cython.operator.dereference(self._ptr).tilt_status)
^
------------------------------------------------------------

/home/derekjr-laptop/libfreenect/wrappers/python/freenect.pyx:124:25:
'operator' not a valid cython attribute or is being used incorrectly

Error converting Pyrex file to C:
------------------------------------------------------------
...
cdef freenect_raw_tilt_state* _ptr
def __repr__(self):
return "<State Pointer>"

def _get_accelx(self):
return
int(cython.operator.dereference(self._ptr).accelerometer_x)
^
------------------------------------------------------------

/home/derekjr-laptop/libfreenect/wrappers/python/freenect.pyx:112:51:
Cannot convert 'freenect_raw_tilt_state *' to Python object

Error converting Pyrex file to C:
------------------------------------------------------------
...

def _get_accelx(self):
return
int(cython.operator.dereference(self._ptr).accelerometer_x)

def _get_accely(self):
return
int(cython.operator.dereference(self._ptr).accelerometer_y)
^
------------------------------------------------------------

/home/derekjr-laptop/libfreenect/wrappers/python/freenect.pyx:115:51:
Cannot convert 'freenect_raw_tilt_state *' to Python object

Error converting Pyrex file to C:
------------------------------------------------------------
...

def _get_accely(self):
return
int(cython.operator.dereference(self._ptr).accelerometer_y)

def _get_accelz(self):
return
int(cython.operator.dereference(self._ptr).accelerometer_z)
^
------------------------------------------------------------

/home/derekjr-laptop/libfreenect/wrappers/python/freenect.pyx:118:51:
Cannot convert 'freenect_raw_tilt_state *' to Python object

Error converting Pyrex file to C:
------------------------------------------------------------
...

def _get_accelz(self):
return
int(cython.operator.dereference(self._ptr).accelerometer_z)

def _get_tilt_angle(self):
return int(cython.operator.dereference(self._ptr).tilt_angle)
^
------------------------------------------------------------

/home/derekjr-laptop/libfreenect/wrappers/python/freenect.pyx:121:51:
Cannot convert 'freenect_raw_tilt_state *' to Python object

Error converting Pyrex file to C:
------------------------------------------------------------
...

def _get_tilt_angle(self):
return int(cython.operator.dereference(self._ptr).tilt_angle)

def _get_tilt_status(self):
return int(cython.operator.dereference(self._ptr).tilt_status)
^
------------------------------------------------------------

/home/derekjr-laptop/libfreenect/wrappers/python/freenect.pyx:124:51:
Cannot convert 'freenect_raw_tilt_state *' to Python object
building 'freenect' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -
Wstrict-prototypes -fPIC -I/usr/include/python2.6 -c freenect.c -o
build/temp.linux-x86_64-2.6/freenect.o -fPIC -I ../../include/ -I /usr/
include/libusb-1.0/ -I /usr/local/include/libusb-1.0 -I /usr/local/
include -I ../c_sync/
freenect.c:1: error: #error Do not use this file, it is the result of
a failed Cython compilation.
error: command 'gcc' failed with exit status 1

I have a felling I have installed the wrong cython or something but I
have no idea where to get it because I was going to get it from the
software center, but that didn't help. If there is anyone who could
help me or point me where to download the right software to build it,
that would be much appreciated.

ash11tw

unread,
Jan 11, 2011, 1:23:39 PM1/11/11
to openk...@googlegroups.com
I have the same problem before.
You need to remove the cython from Ubuntu (which is 0.12) and download the newest version (0.14) from its website
then you should be fine.
 

Derekioh

unread,
Jan 11, 2011, 1:25:26 PM1/11/11
to OpenKinect
I'm sorry, I'm new to ubuntu and I'm still learning to use it. where
would I go to uninstall it?

ash11tw

unread,
Jan 11, 2011, 1:35:18 PM1/11/11
to openk...@googlegroups.com
system->administration->Synaptic Package Manager
search cython
select the one you installed and right click on it.
choose "mark for removal"
then click "apply" on the top toolbar.

or simple way
under terminal
sudo apt-get --purge remove cython

Derekioh

unread,
Jan 11, 2011, 1:51:37 PM1/11/11
to OpenKinect
Alright so I've downloaded the Cython 0.14 and extract it and typed in
the following in the terminal:

python setup.py install

and it gave me and error saying the 'gcc' failed. Is there something
I'm missing? Sorry about this but thank you for helping

ash11tw

unread,
Jan 11, 2011, 2:25:51 PM1/11/11
to openk...@googlegroups.com
maybe missing gcc?
sudo apt-get install python-dev build-essential

and you may need
sudo python setup.py install 

Derekioh

unread,
Jan 12, 2011, 12:24:25 PM1/12/11
to OpenKinect
Well, I'm getting closer. I installed the cython 0.14 which allowed me
to build the python wrapper. But when I go to try the demo
(which I typed this)

sudo python demo_cv_async.py

I got this error:

Traceback (most recent call last):
File "demo_cv_async.py", line 2, in <module>
import freenect
ImportError: /usr/local/lib/python2.6/dist-packages/freenect.so:
undefined symbol: freenect_sync_get_video

The code has a line that uses: freenect.sync_get_video but I'm not
sure what happened. Any ideas?

ash11tw

unread,
Jan 12, 2011, 12:58:29 PM1/12/11
to openk...@googlegroups.com
I don't have that problem.
But you can check this thread.
https://groups.google.com/forum/#!topic/openkinect/ZcQkHWOYfDw


bwh...@dappervision.com

unread,
Jan 12, 2011, 1:12:11 PM1/12/11
to OpenKinect
You need to build the main libfreenect driver and install it. Make
the build directory, cmake .., make, sudo make install.

-Brandyn

Derekioh

unread,
Jan 12, 2011, 7:41:42 PM1/12/11
to OpenKinect
I built and installed the libfreenect driver and I could play the demo
using:
freenect-glview

it's just when I try to play the demo of the python wrapper, it gives
the error. Did I build one of them wrong possibly?

AK

unread,
Jan 29, 2011, 12:19:57 PM1/29/11
to OpenKinect
Me having the same problem as Derek! Please help.. THe python wrappers
are not running..

On Jan 13, 5:41 am, Derekioh <Derek...@yahoo.com> wrote:
> I built and installed the libfreenect driver and I could play the demo
> using:
> freenect-glview
>
> it's just when I try to play the demo of thepythonwrapper, it gives

bwh...@dappervision.com

unread,
Jan 30, 2011, 11:59:25 AM1/30/11
to openk...@googlegroups.com
You guys need a recent version of Cython.  Build it from source or use easy_install cython.  I have several machines with 10.10 using the python drivers and it didn't require any customization.

bwh...@dappervision.com

unread,
Jan 31, 2011, 12:17:49 PM1/31/11
to openk...@googlegroups.com
I pushed a patch that makes Cython optional and it only uses it if it is a compatible version.  Let me know if that helps.
Reply all
Reply to author
Forward
0 new messages