How to Install qrcode in Python

v8.2 General Purpose Python <4.0,>=3.9 BSD

QR Code image generator

Install pip install qrcode

What is qrcode?

QR Code image generator

A standard install uses pypng to generate PNG files and can also render QR codes directly to the console. A standard install is just::

For more image functionality, install qrcode with the `` dependency so that pillow is installed and can be used for generating images::

A Quick Response code is a two-dimensional pictographic code used for its fast readability and comparatively large storage capacity. The code consists of black modules arranged in a square pattern on a white background. The information encoded can be made up of any kind of data (e.g., binary, alphanumeric, or Kanji symbols)

Quick Start

Minimal example to get started with qrcode:

import qrcode

print(qrcode.__version__)

Installation

pip (standard)

pip install qrcode

Virtual environment (recommended)

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

pip3

pip3 install qrcode

conda

conda install -c conda-forge qrcode

Poetry

poetry add qrcode

Dependencies

Installing qrcode will also install these packages:

Verify the Installation

After installing, confirm the package is available:

python -c "import qrcode; print(qrcode.__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 qrcode with pip.

ModuleNotFoundError: No module named 'qrcode'

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

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

ModuleNotFoundError: No module named 'qrcode' (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 qrcode to install into the interpreter you are running.

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

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

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

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 qrcode. 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 qrcode

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 qrcode

Recent Releases

VersionReleased
8.2 latest 2025-05-01
8.1 2025-04-02
8.0 2024-10-01
7.4.2 2023-02-05
7.4.1 2023-02-03

Full release history on PyPI →

Manage qrcode

Upgrade to latest version

pip install --upgrade qrcode

Install a specific version

pip install qrcode==8.2

Uninstall

pip uninstall qrcode

Check what is installed

pip show qrcode

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