VectleSkillsModuleNotFoundError: No module named 'Crypto'

ModuleNotFoundError: No module named 'Crypto'

Export

Third-person routing: this skill fixes ModuleNotFoundError: No module named 'Crypto' after installing PyCryptodome or pycrypto. It covers the pip-name vs import-name mismatch, the Windows crypto-vs-Crypto namespace collision, and cleaning out conflicting installs. Use when code does from Crypto.Cipher import AES and the import fails. Not for Cryptodome namespace (pycryptodomex) or old pycrypto-specific errors.

ModuleNotFoundError: No module named 'Crypto'

TL;DR: the import is Crypto but the pip package is pycryptodome. Run pip install pycryptodome. If it is already installed and still fails, you have a namespace collision: pip uninstall -y crypto pycrypto pycryptodome then pip install pycryptodome.

ModuleNotFoundError: No module named 'Crypto'

The fix

  1. Install the right package:
python -m pip install pycryptodome
python -c "from Crypto.Cipher import AES; print('ok')"

Success check: prints ok.

  1. If it is already installed but still fails, check for squatters:
python -m pip list 2>/dev/null | grep -i -E "crypto"

If you see crypto or pycrypto alongside pycryptodome, nuke all three and reinstall only pycryptodome:

python -m pip uninstall -y crypto pycrypto pycryptodome
python -m pip install --no-cache-dir pycryptodome
  1. On Windows, check site-packages for a lowercase crypto folder and delete it by hand if the uninstall left it behind.

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

When this applies

  • from Crypto.Cipher import AES (or any Crypto.* import) fails.
  • You ran pip install crypto and expected the Crypto namespace; that is a different, unrelated package.

When it does NOT apply

  • Your code imports Cryptodome (with an o): that needs the pycryptodomex package instead.
  • ImportError: cannot import name 'AES' from 'Crypto.Cipher': the namespace exists but something else is off; see the AES variant skill.

Tool and version compatibility

pycryptodome 3.x, Python 3.6+, Windows/Linux/macOS. pycrypto is dead; do not install it.

Why it happens

PyCryptodome installs under the Crypto namespace but is published as pycryptodome on PyPI. The unrelated crypto package claims the same namespace, and on Windows the filesystem is case-insensitive so crypto and Crypto collide. pip then installs PyCryptodome's files into the squatter's directory.

Edge cases

  • Multiple interpreters: always use python -m pip so pip and python are the same environment.
  • A file named Crypto.py in your project shadows the package; rename it.
  • pycryptodomex is the conflict-free alternative (from Cryptodome.Cipher import AES) if you must coexist with old pycrypto.

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

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