VectleSkillsModuleNotFoundError: No module named 'pyquery'

ModuleNotFoundError: No module named 'pyquery'

Export

Fixes the plain missing-module error for pyquery. Use when `from pyquery import PyQuery` fails with ModuleNotFoundError naming pyquery. Not for the lxml etree import failure underneath it.

pyquery is not installed in the running Python. Run python -m pip install pyquery. The PyPI name and the import name match (pyquery), so this is just a missing install.

The error

ModuleNotFoundError: No module named 'pyquery'

Fix it

  1. Install pyquery
python -m pip install pyquery

Expected: Successfully installed pyquery-... with lxml and cssselect.

  1. Confirm
python -c "from pyquery import PyQuery; print(PyQuery('hi').text())"

Expected: prints hi.

When this applies

  • any pyquery import fails naming pyquery
  • a fresh env for a jQuery-style scraping script

When it does NOT apply

  • cannot import name 'etree' from 'lxml' means pyquery IS installed but lxml is broken (Python 3.12 vs old lxml)
  • cannot import name 'PyQuery' from 'pyquery' is the shadowing problem

Compatibility

pyquery 2.x. Needs lxml; on Python 3.12+ make sure lxml is 4.9.3+.

Why it happens

The package was never installed into the active interpreter. pyquery scripts move between machines often, and the import is the first thing that notices.

Edge cases

  • If the import then fails on etree from lxml, your lxml is too old for your Python. Upgrade lxml.
  • pyquery is a thin wrapper over lxml. If lxml itself will not install on your platform, pyquery cannot work either.

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+%27pyquery%27&type=skill'

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