New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
python error: module 'html5lib.treebuilders' has no attribute '_base' #316
Comments
Is this your own build? If so on what distribution? Your "ls" command does in fact show _base.py in your listing of files. It comes just before base.py, which directly contradicts what you are saying. |
|
I have solved the problem:
|
It's an issue with the newest version of html5lib. The latest version of upstream bs4 accommodates it. We may have to look into incorporating upstream bs4 changes in our sigil_bs4. https://bugs.launchpad.net/beautifulsoup/+bug/1603299 Possibly a simple try/except clause in our sigil_bs4 to work with all html5lib versions. A temporary workaround for Linux users who installed html5lib with pip3 would be to force downgrade html5lib to an earlier version with pip3 We'll run into the same problem if we upgrade html5lib to the latest version in our Windows/Mac bundled Python. |
Actually, our version of sigil_bs4 accommodates this already. I'd suspect upstream Ubuntu of changing something, but they'd be more prone to replace sigil_bs4 entirely than leave it in and break it. Are you certain you didn't try to replace sigil_bs4? EDIT: Yes: from your first post, this is most definitely not from the official sigil_bs4/builder/_html5lib.py source
Someone upstream has either built from faulty source, or you've altered the contents of sigil_bs4/ after installing. |
I've confirmed that your error message does not align with the code/files in sigil_bs4/ that is being delivered with the Sigil binary package from the standard Ubuntu 16.04 software repositories. Closing this issue as it appears to be a self-inflicted problem. |
Apologies. The _html5lib.py IS broken in the older version of Sigil (v0.9.5) being provided by the 16.04 repositories (beyond a certain version of the html5lib). However ...using the standard Ubuntu repository-provided html5lib (apt-get install python3-html5lib) should ensure you don't experience this issue. Recommendation:
If the repo-provided htmllib is newer then what Sigil v0.9.5 can use, then I recommend installing Sigil v0.9.8 from ppa:mapreri/sigil PPA. |
Closing this, as it's fixed in the latest version of Sigil |
I have solved this problem by using your method, thank you! |
This should not be needed with any recent version of Sigil. What Sigil version are you using? |
actually I did not use Sigil, and I don't know what is Sigil, I just met a similar problem. |
And commented about it in Sigil github issues on a bug that was fixed over 2 years ago. |
I wonder how you could possibly solve your problem by editing the file /usr/share/sigil/plugin_launchers/python/sigil_bs4/builder/_html5lib.py if you don't use sigil.... Whatever software you do use that is self-declared as totally unrelated to this repository has quite possibly been subtly broken by API-level incompatibilities, though, which you are papering over by editing a file you don't understand, from a project you don't use. If you had any idea what you were doing, you would know this... /me headdesk 🤦🤦🤦 |
Thank you for your reply and guide. I just searched that Sigil is an open source software. I met this problem because I was learning how to use the BeautifulSoup, the _html5lib.py is a file that inside the BeautifulSoup folders, and I just got the same Traceback message as this issue, so I tried to use this method to solve it, even though I don't very understand the principles. I'm learning it now. |
and if my reply is not permitted in this issue, I will delete it |
Thank you very much, this fixed the error perfectly. |
This should not be needed with any recent version of Sigil. What Sigil version are you using? |
I have no idea what Sigil is to be honest, but it was still helpful for another app (Anki). |
Again??? Why are people posting about non-Sigil related stuff here. The problem is a fundamental API problem. You need to use the correct versions of beautifulsoup and html5lib in your application. If you do, things work. If you don't, things break. After careful evaluation of the versions involved, the Sigil developers determined it was safe to rename one specific version of their beautifulsoup fork without ill effects. You cannot just rename things willy-nilly, it may not work or it may seem to work but then break in subtle ways. Your other program has a good chance of being broken in subtle ways now. It should be fixed properly... Please consult the upstream developers of your other program. |
sigil cannot run. ( KDEneon X64 based on ubuntu16.04lts)
check the dir /html5lib/treebuilders :
the module file "base.py" exists in html5lib, but the "_base.py" not exists.
it does not work that copying base.py to _base.py。
The text was updated successfully, but these errors were encountered: