question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AttributeError: 'module' object has no attribute '_base' with beautifulsoup4 4.4.0

See original GitHub issue

I install grow by pip install:

$ pip install grow
$ # or 
$ pip install https://github.com/grow/grow/archive/master.zip

then run:

$ grow --help
Traceback (most recent call last):
  File "/home/miniconda2/envs/flecom/bin/grow", line 34, in <module>
    from grow.common import ca_certs_locater
  File "/home/miniconda2/envs/flecom/lib/python2.7/site-packages/grow/__init__.py", line 12, in <module>
    from .pods.pods import Pod
  File "/home/miniconda2/envs/flecom/lib/python2.7/site-packages/grow/pods/pods.py", line 3, in <module>
    from . import catalog_holder
  File "/home/miniconda2/envs/flecom/lib/python2.7/site-packages/grow/pods/catalog_holder.py", line 10, in <module>
    from grow.common import utils
  File "/home/miniconda2/envs/flecom/lib/python2.7/site-packages/grow/common/utils.py", line 9, in <module>
    import bs4
  File "/home/miniconda2/envs/flecom/lib/python2.7/site-packages/bs4/__init__.py", line 30, in <module>
    from .builder import builder_registry, ParserRejectedMarkup
  File "/home/miniconda2/envs/flecom/lib/python2.7/site-packages/bs4/builder/__init__.py", line 314, in <module>
    from . import _html5lib
  File "/home/miniconda2/envs/flecom/lib/python2.7/site-packages/bs4/builder/_html5lib.py", line 70, in <module>
    class TreeBuilderForHtml5lib(html5lib.treebuilders._base.TreeBuilder):
AttributeError: 'module' object has no attribute '_base'

Upgrading to the latest beautifulsoup4 fixes the problem.

$  pip install --no-cache-dir --upgrade beautifulsoup4
Collecting beautifulsoup4
  Downloading beautifulsoup4-4.5.3-py2-none-any.whl (85kB)
    100% |████████████████████████████████| 92kB 1.1MB/s 
Installing collected packages: beautifulsoup4
  Found existing installation: beautifulsoup4 4.4.0
    Uninstalling beautifulsoup4-4.4.0:
      Successfully uninstalled beautifulsoup4-4.4.0
Successfully installed beautifulsoup4-4.5.3
$ grow --help
Warning: libyaml missing, using slower yaml parser.
Usage: grow [OPTIONS] COMMAND [ARGS]...

  Grow is a declarative file-based website generator. Read docs at
  https://grow.io. This is version 0.1.0.
....

So I think we should change the beautofulsoup4 version in requirements.txt file.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Zoramitecommented, Apr 10, 2017
1reaction
Zoramitecommented, Apr 10, 2017

Thanks. When we do the release builds my understanding is that the release binary packages the libyaml so the libyaml should only be an issue when you are installing from master or from the cloned repo.

I’ve added the upgrade command to our make file so that people using a cloned version can get the benefit of the faster parser.

Also check out the https://github.com/grow/grow#developing-grow-itself instructions if you are thinking of using grow from a clone.

Read more comments on GitHub >

github_iconTop Results From Across the Web

beautifulsoup, html5lib: module object has no attribute _base
I upgraded beautifulsoup4 and html5lib and it resolved the issue. pip install --upgrade beautifulsoup4 pip install --upgrade html5lib.
Read more >
Beautiful Soup Documentation — Beautiful Soup 4.4.0 ...
AttributeError : 'ResultSet' object has no attribute 'foo' - This usually happens because you expected find_all() to return a single tag or string....
Read more >
Beautiful Soup 4.9.0 documentation - Crummy
AttributeError : 'ResultSet' object has no attribute 'foo' - This usually happens because you expected find_all() to return a single tag or string....
Read more >
module 'panel' has no attribute 'interact' · Issue #398 - GitHub
I did find that conda install -c pyviz pyviz requires a downgrade to Python 3.6. My guess is that there is a requirement...
Read more >
[Solved] AttributeError: 'module' object has no attribute
Click here to subscribe - https://www.youtube.com/channel/UCeVMnSShP_Iviwkknt83cww▻Instagram ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found