How to Install Faker in Python

v40.13.0 Testing & QA Python >=3.10 MIT License

Faker is a Python package that generates fake data for you.

Install pip install Faker

What is Faker?

Faker is a Python package that generates fake data for you.

Faker is a Python package that generates fake data for you. Whether you need to bootstrap your database, create good-looking XML documents, fill-in your persistence to stress test it, or anonymize data taken from a production service, Faker is for you.

Faker is heavily inspired by , , and by .

Starting from version `` only supports Python 3.8 and above. If you still need Python 2 compatibility, please install version `` in the meantime, and please consider updating your codebase to support Python 3 so you can enjoy the latest features `extended docs` for more details, especially if you are upgrading from version `` and below as there might be breaking changes.

Quick Start

Minimal example to get started with Faker:

from faker import Faker

fake = Faker()
print(fake.name())          # Random full name
print(fake.email())         # Random email
print(fake.address())       # Random address

# Localized data
fake_de = Faker("de_DE")
print(fake_de.city())

Installation

pip (standard)

pip install Faker

Virtual environment (recommended)

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

pip3

pip3 install Faker

conda

conda install -c conda-forge Faker

Poetry

poetry add Faker

Dependencies

Installing Faker will also install these packages:

Verify the Installation

After installing, confirm the package is available:

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

ModuleNotFoundError: No module named 'faker'

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

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

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

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

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

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

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

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 Faker

Recent Releases

VersionReleased
40.13.0 latest 2026-04-06
40.12.0 2026-03-30
40.11.1 2026-03-23
40.10.0 2026-03-13
40.11.0 2026-03-13

Full release history on PyPI →

Manage Faker

Upgrade to latest version

pip install --upgrade Faker

Install a specific version

pip install Faker==40.13.0

Uninstall

pip uninstall Faker

Check what is installed

pip show Faker

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