Skip to main content
FastF1 can be installed from PyPI using pip or from conda-forge using conda.

Requirements

Before installing FastF1, ensure you have:
  • Python 3.10 or higher
  • pip or conda package manager

Installation Methods

The recommended method is to install FastF1 using pip:
pip install fastf1
This will install FastF1 and all required dependencies.

Dependencies

FastF1 automatically installs the following core dependencies:
  • pandas (≥2.1.1): DataFrame functionality
  • numpy (≥1.26.0): Numerical operations
  • matplotlib (≥3.8.0): Plotting and visualization
  • requests (≥2.30.0): HTTP requests
  • requests-cache (≥1.0.0): HTTP response caching
  • scipy (≥1.11.0): Scientific computing
Additional dependencies include: cryptography, platformdirs, pydantic, pyjwt, python-dateutil, signalrcore, rapidfuzz, timple, and websockets.
For the complete and current list of dependency version requirements, refer to the dependencies section in pyproject.toml.

Configuring the Cache

Enabling the cache is critical for performance and to avoid exceeding API rate limits. Always configure the cache before loading any session data.
FastF1 uses a two-stage caching system to store API responses and parsed data. Configure the cache immediately after importing FastF1:
import fastf1

# Enable cache with a custom directory
fastf1.Cache.enable_cache('path/to/cache/folder')

Cache Directory Options

The cache directory is determined by the following precedence:
  1. Explicit configuration via Cache.enable_cache()
  2. Environment variable FASTF1_CACHE
  3. OS-specific default location:
    • Windows: %LOCALAPPDATA%\Temp\fastf1
    • macOS: ~/Library/Caches/fastf1
    • Linux: ~/.cache/fastf1 (or ~/.fastf1 if ~/.cache doesn’t exist)
Create a dedicated directory for the cache. The cache can grow to several gigabytes depending on usage, but you can delete cached data at any time to reclaim disk space.

Cache Configuration Example

import fastf1
import os

# Create cache directory if it doesn't exist
cache_dir = os.path.expanduser('~/fastf1_cache')
if not os.path.exists(cache_dir):
    os.makedirs(cache_dir)

# Enable the cache
fastf1.Cache.enable_cache(cache_dir)

# Now you can load sessions
session = fastf1.get_session(2023, 'Monaco', 'Q')
session.load()

Advanced Cache Options

The enable_cache() method supports additional parameters:
fastf1.Cache.enable_cache(
    cache_dir='path/to/cache',
    ignore_version=False,      # Ignore cache version mismatches (not recommended)
    force_renew=False,          # Force re-download of all data
    use_requests_cache=True     # Enable Stage 1 HTTP response caching
)

Verifying Installation

Verify that FastF1 is installed correctly:
import fastf1

print(fastf1.__version__)
You can also check the cache status:
import fastf1

fastf1.Cache.enable_cache('~/fastf1_cache')
print(fastf1.Cache)  # Shows cache location and size

Special Environments

Pyodide and WASM

FastF1 has limited compatibility with Pyodide, JupyterLite, and other WASM-based environments. Installation requires additional steps:

JupyterLite FastF1 Guide

External repository with installation instructions and examples for WASM environments
See GitHub Issue #667 for community discussion and workarounds.

Troubleshooting

Cache Directory Not Found

If you see NotADirectoryError: Cache directory does not exist!, create the directory first:
import os

cache_dir = 'path/to/cache'
os.makedirs(cache_dir, exist_ok=True)
fastf1.Cache.enable_cache(cache_dir)

Module Import Errors

Ensure all dependencies are installed correctly:
pip install --upgrade fastf1

Next Steps

Quickstart Guide

Learn how to load session data and access telemetry with a complete working example

Build docs developers (and LLMs) love