Closed joaopaulosilvasimoes closed 11 months ago
Add this before importing beautifulsoup4
import imp
import sys
class ImportBlocker(object):
def __init__(self, *args):
self.black_list = args
def find_module(self, name, path=None):
if name in self.black_list:
return self
return None
def load_module(self, name):
module = imp.new_module(name)
module.__all__ = [] # Necessary because of how bs4 inspects the module
return module
sys.meta_path = [ImportBlocker('bs4.builder._htmlparser')]
Enviroment:
-- Issue:
I am developing an application that is working correctly when I run directly on my computer, however I run on my phone it presents a series of errors related to BS4 (BeautifulSoup).
As one of the libraries I use is "Skpy" https://pypi.org/project/SkPy, and it makes use of BeautifulSoap, so I can not substitute it directly, since it's a third-party library.
When I comment the use of the library in the application works normally, both on the PC and on the device.
I've done tests with Python 3.6 using NDK and the current Python 2.7 model, and the error is simply the same, I do not know how to proceed.
Has anyone ever experienced this?
-- Sample:
-- buildozer.spec
-- Log: