Python for Android: Cython file compilation error
After git cloning python-for-android, I tried to build a distro:
./distribute.sh -m "kivy"
And got a few errors like this:
Error compiling Cython file:
------------------------------------------------------------
...
vertex_format.last_shader = self
for i in xrange(vertex_format.vattr_count):
attr = &vertex_format.vattr[i]
if attr.per_vertex == 0:
continue
attr.index = glGetAttribLocation(self.program, <char *><bytes>attr.name)
^
------------------------------------------------------------
kivy/graphics/shader.pyx:448:63: Casting temporary Python object to non-numeric non-Python type
Found this answer which didn't help solve my problem:
sudo apt-get remove --purge cython
sudo pip install cython
Do I need a specific version of Cython?
Thank!
Update
Thanks to @RyanP, I tried to run:
cython -V
cython shader.pyx
Well the Cython version looks ok:
Cython version 0.21
But still shader.pyx won't compile with the same error.
Another update
I did both:
- Used the advice of @inclement and removed both
build
anddist
. - Used by
export P4A_kivy_DIR=/path/to/cloned/kivy/
Finally it was created dist/default
.
+3
source to share
1 answer
I don't believe this was built for Cython 0.21, but for Cython 0.20, try installing kivy with cython 0.20
pip install cython == 0.20
Here is a thread describing the problem
https://mail.python.org/pipermail/cython-devel/2014-October/004210.html
+6
source to share