I'm trying to build a simple kivy app with buildozer and python3, but for some reason inside this build no module 'requests'. I have tried to manually include this module as "required" for build in python, but this caused the error as far as 'requests" is already included in python3. I'm not sure on which side this problem is: buildozer or python-for-android.
Source:
from kivy.app import App
from kivy.uix.label import Label
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.scatter import Scatter
import requests
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()
Log from logcat:
09-19 16:50:50.429 14737 14756 I python: [INFO ] [Text ] Provider: sdl2
09-19 16:50:50.442 14737 14756 I python: Traceback (most recent call last):
09-19 16:50:50.442 14737 14756 I python: File "main.py", line 5, in
09-19 16:50:50.444 14737 14756 I python: import requests
09-19 16:50:50.444 14737 14756 I python: ImportError: No module named 'requests'
09-19 16:50:50.508 14737 14756 I python: Python for android ended.
just add the following directory to the project
charset_normalizer, idna, urllib3, requests,
it work for me
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.