Your html5lib is too old (or too new) for the BeautifulSoup version in the chain: bs4 reaches for `html5lib.treebuilders._base`, which only exists in compatible html5lib releases. Upgrade html5lib with `python -m pip install -U html5lib` and the AttributeError goes away. If you pinned old versions deliberately, unpin them together.

## The error

```text
AttributeError: module 'html5lib.treebuilders' has no attribute '_base'
```

## Fix it

1. **Upgrade html5lib**

```
python -m pip install -U html5lib
```
Expected: installs html5lib 1.1.

2. **Confirm the import chain**

```
python -c "import mechanicalsoup; print('ok')"
```
Expected: prints `ok`. bs4 finds the `_base` attribute it expects.

3. **If it persists, refresh the whole parsing stack together**

```
python -m pip install -U beautifulsoup4 html5lib lxml
```
Expected: mutually compatible releases. Version skew between these three is the entire category of bug.

## When this applies

- the AttributeError names `html5lib.treebuilders` and `_base`
- it fires during `import mechanicalsoup` or `from bs4 import BeautifulSoup` with the html5lib parser
- an old lockfile pins html5lib to a pre-1.0 release

## When it does NOT apply

- `No module named 'html5lib'` is the missing install, different fix
- `No module named 'bs4'` deeper in the chain is the stub problem

## Compatibility

html5lib 1.1 is the current release and the one bs4 expects. The `_base` module exists in html5lib 1.x; pre-1.0 layouts differ.

## Why it happens

BeautifulSoup's html5lib tree builder imports html5lib's internal `treebuilders._base` module. html5lib 0.x organized its internals differently, so a bs4 new enough to expect `_base` paired with an html5lib old enough not to have it crashes with AttributeError at import. It is pure version skew, usually from a lockfile that pinned html5lib years ago while bs4 floated forward.

## Edge cases

- If you do not use the html5lib parser anywhere, you can also dodge this by parsing with `lxml` or `html.parser` instead of upgrading. But upgrading is cleaner.
- Some distros ship patched html5lib. Prefer the PyPI release in your venv over the system package.
