3

After git cloning python-for-android I tried creating a distribution:

./distribute.sh -m "kivy"

And got few errors of this kind:

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 did not solve my problem:

sudo apt-get remove --purge cython
sudo pip install cython

Do I need a specific Cython version?

Thanks!

Update

Thanks to @RyanP I tried running:

cython -V
cython shader.pyx

Well, Cython version seems ok:

Cython version 0.21

But still, shader.pyx won't compile with the very same error.

Another update

I did both:

  1. Used @inclement advice and removed both build and dist .
  2. Used export P4A_kivy_DIR=/path/to/cloned/kivy/

And dist/default was finally created.

Michael
  • 3,206
  • 5
  • 26
  • 44
  • 1
    This code will build with Cython 0.21. If those instructions didn't work for you, then there is a problem on your system preventing you from running the correct Cython. – kitti Oct 07 '14 at 15:33
  • Thanks @RyanP I searched my entire system `find / -name "cython"` and found only cython 0.21 – Michael Oct 07 '14 at 16:32
  • 3
    The problem is it's trying to compile a non-master pyjnius. Could you delete the `build` and `dist` folders in your python-for-android, and try again? – inclement Oct 07 '14 at 16:56
  • I think i encountered this try use ./distribute.sh -f -m "kivy==master" i think cython 0.21 does not work with kivy 1.8. maybe worth using master anyway as kivy 1.9 is not supposed to be that far away. – Oly Mar 24 '15 at 10:28

1 Answers1

6

I don't believe this was build for Cython 0.21 but for Cython 0.20 try to install kivy with cython 0.20

pip install cython==0.20

Here is a thread describing the issue

https://mail.python.org/pipermail/cython-devel/2014-October/004210.html

user1634074
  • 681
  • 8
  • 17