What requirements to add for requests and bs4 modules?

572 views
Skip to first unread message

Giù sé

unread,
Jun 22, 2020, 5:40:31 AM6/22/20
to Kivy users support
I have included a function for webscraping in my Kivy app which uses the modules 'requests' and 'BeautifulSoup', so that my code includes:

import requests
from bs4 import BeautifulSoup

in my buildozer.spec I included the requirements as follows:

requirements = python3,kivy==master,sqlite3,pathlib,android,requests,bs4

However, the app crashed on Android. The logfile complained about no module named 'urllib3', so I added it to the requirements as well:

requirements = python3,kivy==master,sqlite3,pathlib,android,requests,bs4,urllib3

Now the error is: no module named 'chardet'.

I imagine these modules are needed by either 'requests' or 'bs4'. Shall I keep adding one at a time all the modules not found? How can I know exactly which requirements I should add?

Robert Flatt

unread,
Jun 22, 2020, 1:06:25 PM6/22/20
to Kivy users support
Shall I keep adding one at a time all the modules not found?
yes

How can I know exactly which requirements I should add?
when you are not adding any more  :(  really.


So I don't think you need pathlib, or android; and probably not requests. And bs4 should be the name that pip uses.
chardet I know nothing about.
Message has been deleted

Giù sé

unread,
Jun 23, 2020, 4:42:38 PM6/23/20
to Kivy users support
I finally solved this. Had to add 'urllib3', 'chardet' and 'idna', as well as to replace 'bs4' with 'beautifulsoup4'.
Also (in case someone will run into the same issue) it is important to add internet permission for the app in buildozer.spec.
Reply all
Reply to author
Forward
0 new messages