"ImportError: Cannot import name spawnu" while building apk using kivy

1k views Asked by At

I was building a simple android app using kivy using the below code:

from kivy.app import App
from kivy.uix.label import Label
from kivy.uix.scatter import Scatter
from kivy.uix.floatlayout import FloatLayout

class TutorialApp(App):
    def build(self):
        f = FloatLayout()
        s = Scatter()
        l = Label(text="Hello!",
                  font_size=150)

        f.add_widget(s)
        s.add_widget(l)

        return f

if __name__ == "__main__":
    TutorialApp().run()

I am building this code into an apk using buildozer. I wrote

buildozer android debug

This gave the following error:

https://i.stack.imgur.com/l6fxO.jpg

How can I rectify this error.

1

There are 1 answers

0
Magic9995 On

It seems that python or the kivy compiler is unable to import a package named spawnu.Spawnu is part of pexpect package. Try

sudo pip install pexpect
sudo pip install pexpect --upgrade

Worked for me. Good Luck!!