2014-10-07 49 views
2

後混帳克隆蟒蛇換機器人我試圖創建分發:的Python換安卓錯誤編譯用Cython文件

./distribute.sh -m "kivy" 

,得到了這樣的幾個誤區:

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 

找到this answer,這並沒有解決我的問題:

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

我需要一個特定的Cython版本嗎?

謝謝!

更新

感謝@RyanP我試圖運行:

cython -V 
cython shader.pyx 

好,用Cython版本似乎確定:

Cython version 0.21 

但儘管如此,shader.pyx不會編譯與非常相同的錯誤。

另一個更新

我做了兩個:

  1. 使用@inclement建議和取出都和builddist
  2. 使用export P4A_kivy_DIR=/path/to/cloned/kivy/

而且dist/default終於創建。

+1

此代碼將使用Cython 0.21構建。如果這些說明不適合你,那麼你的系統有一個問題妨礙你運行正確的Cython。 – 2014-10-07 15:33:45

+0

謝謝@RyanP我搜索了我的整個系統'find/-name「cython」',發現只有cython 0.21 – Michael 2014-10-07 16:32:22

+3

問題是它試圖編譯一個非主pyjnius。你可以在你的python-for-android中刪除'build'和'dist'文件夾,然後再試一次嗎? – inclement 2014-10-07 16:56:52

回答