Buildozer python3 error: " ImportError: No module named 'requests' "

1,235 views
Skip to first unread message

Дмитрий Горбатенко

unread,
Sep 19, 2017, 8:29:53 AM9/19/17
to Kivy users support
Hello, 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 <module>

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.

Geekademy

unread,
Sep 19, 2017, 7:21:14 PM9/19/17
to kivy-...@googlegroups.com
Requests is not included with Python 3, try adding it to your requirements line.

Alexander Taylor

unread,
Sep 19, 2017, 7:47:37 PM9/19/17
to Kivy users support
requests isn't available with the python3 build yet, because it depends on openssl which also isn't available. I'm currently working on fixing this.

Дмитрий Горбатенко

unread,
Sep 19, 2017, 11:26:57 PM9/19/17
to Kivy users support
Can you say something about any approximate dates when it will be ready? I've tried to use urllib and kivy.UrlRequest but they are hangs with my specific url. I even built an app with python2 and requests in requirements, but app comes laggy for some reason. I really need python3 and requests. Thanks.

среда, 20 сентября 2017 г., 7:47:37 UTC+8 пользователь Alexander Taylor написал:

Дмитрий Горбатенко

unread,
Sep 19, 2017, 11:27:44 PM9/19/17
to Kivy users support
Of course it is included

среда, 20 сентября 2017 г., 7:21:14 UTC+8 пользователь Geekademy написал:

Geekademy

unread,
Sep 20, 2017, 12:46:51 AM9/20/17
to kivy-...@googlegroups.com

Дмитрий Горбатенко

unread,
Sep 20, 2017, 1:21:51 AM9/20/17
to Kivy users support
python3 -m buildozer android debug
# Check configuration tokens
# Ensure build layout
# Check configuration tokens
# Preparing build
# Check requirements for android
# Run 'dpkg --version'
# Cwd None
Debian 'dpkg' package management program version 1.18.10 (amd64).
This is free software; see the GNU General Public License version 2 or
later for copying conditions. There is NO warranty.
# Search for Git (git)
#  -> found at /usr/bin/git
# Search for Cython (cython)
#  -> found at /usr/local/bin/cython
# Search for Java compiler (javac)
#  -> found at /usr/lib/jvm/java-8-openjdk-amd64/bin/javac
# Search for Java keytool (keytool)
#  -> found at /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/keytool
# Install platform
# Run 'pip install -q --user "appdirs" "colorama>=0.3.3" "sh>=1.10,<1.12.5" "jinja2" "six"'
# Cwd None
# Apache ANT found at /home/kivy/.buildozer/android/platform/apache-ant-1.9.4
# Android SDK found at /home/kivy/.buildozer/android/platform/android-sdk-20
# Android NDK found at /home/kivy/Desktop/crystax-ndk-10.3.2
# Check application requirements
# Check garden requirements
# Compile platform
# Run '/usr/bin/python3 -m pythonforandroid.toolchain create --dist_name=myapp --bootstrap=sdl2 --requirements=python3crystax,kivy,requests --arch armeabi-v7a --copy-libs --color=always --storage-dir=/build/test/android/platform/build'
# Cwd /build/test/android/platform/python-for-android-master
[INFO]:    Will compile for the following archs: armeabi-v7a
[INFO]:    Found Android API target in $ANDROIDAPI
[INFO]:    Available Android APIs are (19)
[INFO]:    Requested API target 19 is available, continuing.
[INFO]:    Found NDK dir in $ANDROIDNDK
[INFO]:    Got NDK version from $ANDROIDNDKVER
[WARNING]: NDK version was set as r10.3.2, but checking the NDK dir claims it is 10.3.2.
[WARNING]: The build will try to continue, but it may fail and you should check that your setting is correct.
[WARNING]: If the NDK dir result is correct, you don't need to manually set the NDK ver.
[INFO]:    Using Crystax NDK r10.3.2
[INFO]:    Found virtualenv at /usr/local/bin/virtualenv
[INFO]:    ccache is missing, the build will not be optimized in the future.
[INFO]:    Found the following toolchain versions: ['4.9', '5', 'clang3.6', 'clang3.7']
[INFO]:    Picking the latest gcc toolchain, here 5
[WARNING]: Missing executable: autoconf is not installed
[WARNING]: Missing executable: automake is not installed
[WARNING]: Missing executable: libtoolize is not installed
[INFO]:    No existing dists meet the given requirements!
[INFO]:    No dist exists that meets your requirements, so one will be built.
[ERROR]:   Didn't find any valid dependency graphs.
[ERROR]:   This means that some of your requirements pull in conflicting dependencies.
[ERROR]:   Exiting.
# Command failed: /usr/bin/python3 -m pythonforandroid.toolchain create --dist_name=myapp --bootstrap=sdl2 --requirements=python3crystax,kivy,requests --arch armeabi-v7a --copy-libs --color=always --storage-dir=/build/test/android/platform/build
# Buildozer failed to execute the last command
# The error might be hidden in the log above this error
# Please read the full log, and search for it before
# raising an issue with buildozer itself.
# In case of a bug report, please add a full log with log_level = 2


среда, 20 сентября 2017 г., 12:46:51 UTC+8 пользователь Geekademy написал:
Reply all
Reply to author
Forward
0 new messages