Jan-06-2017, 01:15 AM
Hi everyone.
I have a program that works fine on my PC but when I try to use buildozer to get it on to my tablet or phone, it installs ok but doesn't load when you run it. Looking at the logcat, it says:
However, as I am very much a newbie at coding at the moment, I can't seem to see how to solve it exactly and so wanted to see if anyone could help me work out the solution..
The stackoverflow thread is here: http://stackoverflow.com/questions/23952...on-android
The code that I'm trying to run that apparently fixed the issue is here:
Without the above code.. there is no problem importing the bs4 module.
Am I missing something obvious?
Many thanks for any guidance! Greatly appreciate it.
I have a program that works fine on my PC but when I try to use buildozer to get it on to my tablet or phone, it installs ok but doesn't load when you run it. Looking at the logcat, it says:
Error:ImportError: cannot import name _htmlparser
So I have had a look around and a few others have had this problem and have solved it. However, as I am very much a newbie at coding at the moment, I can't seem to see how to solve it exactly and so wanted to see if anyone could help me work out the solution..
The stackoverflow thread is here: http://stackoverflow.com/questions/23952...on-android
The code that I'm trying to run that apparently fixed the issue is here:
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')] from bs4 import BeautifulSoupHowever this for me is saying..
Error:from bs4 import BeautifulSoup
ImportError: No module named 'bs4'
Without the above code.. there is no problem importing the bs4 module.
Am I missing something obvious?
Many thanks for any guidance! Greatly appreciate it.