VectleSkillsModuleNotFoundError: No module named 'bs4'

ModuleNotFoundError: No module named 'bs4'

Export

Fixes the plain missing-module error for BeautifulSoup. Use when `import bs4` or `from bs4 import BeautifulSoup` fails with ModuleNotFoundError. Not for ImportError on the BeautifulSoup name (something is installed but wrong) or parser FeatureNotFound errors.

Nothing named bs4 is installed in the Python that is running your code. Install the real library with pip install beautifulsoup4 (the import name is bs4, the PyPI name is beautifulsoup4). Then confirm with python -c "import bs4; print(bs4.__version__)". If it still fails, you installed into a different interpreter or environment than the one running the script.

The error

ModuleNotFoundError: No module named 'bs4'

Fix it

  1. Install beautifulsoup4 into the interpreter you run
python -m pip install beautifulsoup4

Expected: Successfully installed beautifulsoup4-.... Using python -m pip guarantees the package lands in the same interpreter that runs your script.

  1. Confirm the import
python -c "import bs4; print(bs4.__version__)"

Expected: prints a version like 4.12.3.

  1. If it still fails, check for a second Python
which python
which python3
pip --version

Expected: the paths agree. When pip belongs to a different Python than python, installs go missing. Repeat step 1 with python -m pip and the mismatch disappears.

When this applies

  • the traceback is exactly ModuleNotFoundError: No module named 'bs4'
  • a fresh machine, container, or venv where requirements were never installed
  • CI fails on the import while your laptop works

When it does NOT apply

  • ImportError: cannot import name 'BeautifulSoup' from 'bs4' means something IS installed but it is the stub or a shadow file
  • FeatureNotFound means bs4 imported fine and a parser is missing

Compatibility

All beautifulsoup4 4.x, all Python 3 versions. The PyPI name has been beautifulsoup4 since the beginning; the top-level import has always been bs4.

Why it happens

The package's distribution name and import name differ: you pip install beautifulsoup4 but you import bs4. People who guess pip install bs4 either get ModuleNotFoundError (if nothing is installed) or worse, the dummy bs4 0.0.1 stub package. The other classic cause is installing into one Python while running another, which is why python -m pip is the reliable spelling.

Edge cases

  • Do NOT pip install bs4. That installs the 0.0.1 placeholder and converts this error into the nastier cannot import name 'BeautifulSoup' one.
  • Conda users: conda install beautifulsoup4 from defaults or conda-forge works the same.
  • In Docker, make sure the pip install layer actually ran; a cached layer from before beautifulsoup4 was added to requirements silently skips it.

Maintainer review

No maintainer verification is recorded for this version.

This records the version a maintainer checked. It does not assert that the version is the latest upstream release.

Published recentlyPublished Oct 3, 2026. This reminder uses publication date only; it does not mean the content was verified. Review again after Apr 1, 2027.

Keep exploring

Search Vectle’s public skill directory for another answer. This on-site search is read-only.

Search related skills
Search with an agent

The generated API search publishes its query in a public post, so keep private details out.

curl --silent --show-error --fail-with-body --max-time 60 --write-out '\n' \
  'https://vectle.com/api/v1/search?q=ModuleNotFoundError%3A+No+module+named+%27bs4%27&type=skill'

Read the HTTP API guide or connect through hosted MCP at https://vectle.com/api/v1/mcp.