RecycleView causing Kivy executable to crash

Viewed 302

I followed the directions in the Kivy documentation on how to package applications for Windows, but my application crashes as soon as I try to run it. The last line of the traceback suggests a problem with my RecycleView widget:

   File "C:\Users\awende\AppData\Local\Continuum\Anaconda3\lib\site-packages\kivy\factory.py", line 139, in __getattr__
     module = __import__(name=item['module'], fromlist='.')
 ModuleNotFoundError: No module named 'kivy.uix.recycleview.__init__.'
Failed to execute script SingleTabApp

I have tried importing kivy.uix.recycleview in all my .py and .kv files that it wasn't already imported in, but this doesn't seem to be the problem. I am not sure if this is a problem with my code, or if something else is going on.

Other potentially relevant information:

  • I am using Python 3.6.1 with the current dev version of PyInstaller.
  • Kivy version 1.10.0
  • SingleTabApp is the name of my main Python script, and was working correctly prior to using PyInstaller.
2 Answers

install a recent version of cython, notice that for a version of cython there is a corresponding version of kivy. To implement RecycleView, the version of kivy in your "package apk" not your computer must be at least 1.10

I ran across the same problem with PyInstaller on Windows 7. I appied a quick fix to factory_registers.py and it worked! (https://github.com/kivy/kivy/issues/5276)

A quick fix for the issue with pyinstaller is to change e.g. r('RecycleViewBehavior', module='kivy.uix.recycleview.init') to r('RecycleViewBehavior', module='kivy.uix.recycleview').

PS factory_registers.py also has r('RecycleView', module='kivy.uix.recycleview.__init__'), I didn't touch it.

Related