Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python-for-Android: Error compiling Cython file

Tags:

cython

kivy

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.

like image 486
Michael Avatar asked Apr 19 '26 00:04

Michael


1 Answers

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

like image 188
user1634074 Avatar answered Apr 21 '26 23:04

user1634074



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!