Skip to main content
`Ctrl`+`K`

# Creating a development environment

To test out code changes, you’ll need to build pandas from source, which requires a C/C++ compiler and Python environment. If you’re making documentation changes, you can skip to contributing to the documentation but if you skip creating the development environment you won’t be able to build the documentation locally before pushing your changes. It’s recommended to also install the pre-commit hooks.

## Step 1: install a C compiler

Installing a C compiler will depend on your operating system

### Windows

You will need Build Tools for Visual Studio 2026.

Note

If you encounter an error indicating `cl.exe`, reopen the installer and also select the optional component MSVC v142 - VS 2019 C++ x64/x86 build tools in the right pane for installation. If that does not resolve the issue, try installing MSVC v143 - VS 2022 C++ x64/x86 build tools instead. Note that Build Tools for Visual Studio 2022 may also be distributed as Visual Studio Build Tools 2026.

Alternatively, you can install the necessary components on the commandline using vs_BuildTools.exe

Alternatively, you could use the WSL and consult the `Linux` instructions below.

### MacOS

To use the conda-based compilers, you will need to install the Developer Tools using `xcode-select --install`.

If you prefer to use a different compiler, general information can be found in the Python Developer’s Guide.

### Linux

For Linux-based conda installations, you won’t have to install any additional components outside of the conda environment. The instructions below are only needed if your setup isn’t based on conda environments.

Some Linux distributions will come with a pre-installed C compiler. To find out which compilers (and versions) are installed on your system

    # for Debian/Ubuntu:
    dpkg --list | grep compiler
    # for Red Hat/RHEL/CentOS/Fedora:
    yum list installed | grep -i --color compiler

GCC (GNU Compiler Collection), is a widely used compiler, which supports C and a number of other languages. If GCC is listed as an installed compiler nothing more is required.

If no C compiler is installed, or you wish to upgrade, or you’re using a different Linux distribution, consult your favorite search engine for compiler installation/update instructions.

Let us know if you have any difficulties by opening an issue or reaching out on our contributor community Slack.

## Step 2: create a virtual environment

Before proceeding:

- Make sure that you have cloned the repository

- `cd` to the pandas source directory you just created with the clone command

### Option 1: using conda (recommended)

- Install miniforge to get conda

- Create and activate the `pandas-dev` conda environment using the following commands:

    conda env create --file environment.yml
    conda activate pandas-dev

### Option 2: using pip

You’ll need to have at least the minimum Python version that pandas supports.

Unix/macOS with virtualenv

    # Create a virtual environment
    # Use an ENV_DIR of your choice. We'll use ~/virtualenvs/pandas-dev
    # Any parent directories should already exist
    python3 -m venv ~/virtualenvs/pandas-dev

    # Activate the virtualenv
    . ~/virtualenvs/pandas-dev/bin/activate

    # Install the build dependencies
    python -m pip install -r requirements-dev.txt

Unix/macOS with pyenv

Consult the docs for setting up pyenv.

    # Create a virtual environment
    # Use an ENV_DIR of your choice. We'll use ~/.pyenv/versions/pandas-dev
    pyenv virtualenv 3.11 pandas-dev

    # Activate the virtualenv
    pyenv activate pandas-dev

    # Now install the build dependencies in the cloned pandas repo
    python -m pip install -r requirements-dev.txt

Windows

Below is a brief overview on how to set-up a virtual environment with Powershell under Windows. For details please refer to the official virtualenv user guide.

Use an ENV_DIR of your choice. We’ll use `~\\virtualenvs\\pandas-dev` where `~` is the folder pointed to by either `$env:USERPROFILE` (Powershell) or `%USERPROFILE%` (cmd.exe) environment variable. Any parent directories should already exist.

    # Create a virtual environment
    python -m venv $env:USERPROFILE\virtualenvs\pandas-dev

    # Activate the virtualenv. Use activate.bat for cmd.exe
    ~\virtualenvs\pandas-dev\Scripts\Activate.ps1

    # Install the build dependencies
    python -m pip install -r requirements-dev.txt

## Step 3: build and install pandas

pandas uses the Meson build backend via PEP 517 to build the C extensions and install the library.

To compile and install pandas in editable mode, run:

    python -m pip install --verbose --editable . --no-build-isolation

Additional Meson options can be passed to the `pip install` command to modify the installation. Helpful options include:

- `-Ceditable-verbose=true`: Print verbose logs during rebuild, even during `import`.

- `-Cbuilddir="your builddir here"`: Specify a different build directory for the C extensions.

- `-Csetup-args="-Ddebug=true"`: Compile the C extensions with debug symbols.

Note

When pandas is installed in `--editable` mode, pandas will automatically rebuild the library upon `import`, and build logs will show if `-Ceditable-verbose=true` is passed as well.

Now, pandas has been installed into your virtual environment, and the version number will reflect that it’s a development version with a reference to the latest Git hash from which pandas was built.

    In [1]: import pandas

    # Your version will be structured similar, but not match, this example.
    In [2]: print(pandas.__version__)
    3.0.0.dev0+880.g2b9e661fbb.dirty

Note

The version number is pulled from the latest repository tag, so ensure tags were fetched when cloning the repository from your fork.

Additionally, you can try running the test suite.