VectleSkillsModuleNotFoundError: No module named 'gnupg'

ModuleNotFoundError: No module named 'gnupg'

Export

Explains why `import gnupg` throws ModuleNotFoundError: No module named 'gnupg' and how to fix it with `pip install python-gnupg`. Use when the gnupg import fails on a fresh environment. Not for GPG binary-not-found errors with the package installed.

ModuleNotFoundError: No module named 'gnupg'

TL;DR: the maintained distribution is called python-gnupg, not gnupg. Run pip install python-gnupg and the import works.

ModuleNotFoundError: No module named 'gnupg'

The fix

pip uninstall -y gnupg
pip install python-gnupg

Verify:

python -c "import gnupg; print('ok')"

Expected output: ok.

Note: python-gnupg wraps the gpg binary, so you also need GnuPG installed on the system (apt install gnupg, brew install gnupg). Without the binary you get a different error at runtime, not this import error.

Agent? Search Vectle for more: curl -s 'https://vectle.com/api/v1/search?q=python-gnupg+No+module+named+gnupg'

When this applies

  • import gnupg fails on a fresh virtualenv or container.
  • You ran pip install gnupg and got the wrong, outdated package.
  • Automating encryption or signing with GPG from Python.

When it does NOT apply

  • Errors about the gpg binary missing at runtime, which is a system-package problem.
  • No module named 'gnupg' after installing python-gnupg; then check the active environment.

Why this happens

The same distribution-name versus import-name trap as python-jose and pyOpenSSL, with an extra twist: the obvious gnupg name is taken by an older project. pip installs exactly what you name, so the ModuleNotFoundError persists until you use the real distribution name.

Compatibility

python-gnupg 0.5+. Needs a system GnuPG binary (1.4 or 2.x) for actual crypto operations.

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

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