How to Install idna in Python

v3.11 CLI & Utilities Python >=3.8

Internationalized Domain Names in Applications (IDNA)

Install pip install idna

What is idna?

Internationalized Domain Names in Applications (IDNA)

Internationalized Domain Names in Applications (IDNA)

Support for `Internationalized Domain Names in Applications (IDNA) ` and `Unicode IDNA Compatibility Processing `.

The latest versions of these standards supplied here provide more comprehensive language coverage and reduce the potential of allowing domains with known security vulnerabilities. This library is a suitable replacement for the “encodings.idna” module that comes with the Python standard library, but which only supports an older superseded IDNA specification from 2003.

Quick Start

Minimal example to get started with idna:

import idna

print(idna.__version__)

Installation

pip (standard)

pip install idna

Virtual environment (recommended)

python -m venv venv
source venv/bin/activate   # Windows: venv\Scripts\activate
pip install idna

pip3

pip3 install idna

conda

conda install -c conda-forge idna

Poetry

poetry add idna

Verify the Installation

After installing, confirm the package is available:

python -c "import idna; print(idna.__version__)"

If this prints a version number, installation succeeded. If you see a ModuleNotFoundError, see the errors section below.

Installation Errors

Common errors when installing idna with pip.

ModuleNotFoundError: No module named 'idna'

Cause: The package is not installed in the current Python environment.

Fix: Run pip install idna. If using a virtual environment, ensure it is activated first.

ModuleNotFoundError: No module named 'idna' (installed but still failing)

Cause: pip installed the package into a different Python than the one running your script.

Fix: Use python -m pip install idna to install into the interpreter you are running.

ImportError: cannot import name 'X' from 'idna'

Cause: The function or class does not exist in the installed version.

Fix: Check the version with pip show idna and upgrade with pip install --upgrade idna.

pip: command not found

Cause: pip is not in PATH or Python was not added to PATH during installation.

Fix: Try python -m pip install idna. On macOS/Linux try pip3.

PermissionError: [Errno 13] Permission denied

Cause: No write access to the system Python package directory.

Fix: Use a virtual environment, or add --user: pip install --user idna

SSL: CERTIFICATE_VERIFY_FAILED

Cause: pip cannot verify PyPI's SSL certificate — common behind corporate proxies.

Fix: Try: pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org idna

Recent Releases

VersionReleased
3.11 latest 2025-10-12
3.10 2024-09-15
3.9 2024-09-14
3.8 2024-08-23
3.7 2024-04-11

Full release history on PyPI →

Manage idna

Upgrade to latest version

pip install --upgrade idna

Install a specific version

pip install idna==3.11

Uninstall

pip uninstall idna

Check what is installed

pip show idna

Last updated: 2026-04-11 • Data from PyPI