---
title: "Announcing Configurable Python Versions in Netlify Builds"
description: "Netlify now supports configurable Python versions in your builds. Use any version of Python by specifying the desired version through the environment variable."
source: "https://www.netlify.com/blog/announcing-configurable-python-versions-in-netlify-builds/"
last_updated: "2026-07-10T19:16:54.000Z"
---
We’re excited to announce that Netlify now supports **configurable Python versions** in your builds! Previously, only Python `2.7` and `3.8` (in specific patch versions) were supported. Now, you can use **any version** of Python by specifying the desired version through the `PYTHON_VERSION` environment variable.

Whether you’re working on a legacy project that requires an older Python version or taking advantage of the latest features in Python `3.x`, you now have full control over which Python version runs in your builds. This change allows for greater flexibility and ensures that your projects can evolve with the language as new versions are released.

## Why configurable Python versions?

At Netlify, we understand that developers need the freedom to choose the tools and technologies that best fit their projects. Python has undergone significant changes over the years, and supporting multiple versions allows you to build, test, and deploy your projects with the version that fits your requirements.

By allowing you to define the Python version via the `PYTHON_VERSION` environment variable, we’re giving you more control over your build environment, reducing friction when transitioning between versions, and ensuring your builds are always optimized for your needs.

## How to use configurable Python versions

Using a specific Python version in your build can be achieved by setting the `PYTHON_VERSION=3.13` environment variable in your Netlify configuration or the UI.

For example, to specify `Python 3.13`, you can set it either through the UI or in your `netlify.toml` file:

```
[build]  environment = { PYTHON_VERSION = "3.13" }
```

Alternatively, you can set this variable directly in your project’s build settings in the Netlify dashboard:

1.  Navigate to your project settings.
2.  Under **Build & Deploy**, click **Environment Variables**.
3.  Add a new variable named `PYTHON_VERSION` and set it to the desired version (e.g., `3.13`).

![Set the environment variable in the Netlify UI](https://cdn.sanity.io/images/o0o2tn5x/production/642ad702b1c25db2d934425954302028ca5f7ce3-1845x1145.png)

That’s it! Netlify will now use the specified Python version when running your builds.

## Example: Creating a documentation site with [MkDocs](https://www.mkdocs.org/)

With Netlify’s flexible build settings and the newly introduced configurable Python versions, deploying a static site generated with [MkDocs](https://www.mkdocs.org/) has never been easier. [MkDocs](https://www.mkdocs.org/) is a static site generator that’s perfect for documentation sites, and in this guide, we’ll walk through how to deploy a documentation site on Netlify using [MkDocs](https://www.mkdocs.org/) and the popular Material theme.

### Step 1: Install MkDocs with Material theme

First, you need to install [MkDocs](https://www.mkdocs.org/) and the Material theme by adding them to a `requirements.txt` file, which helps define the Python dependencies for your project.

Create a `requirements.txt` file with the following content:

```
mkdocs==1.6mkdocs-material==9.5.41
```

This tells Python’s package manager `pip` to install [MkDocs](https://www.mkdocs.org/) and the Material theme when Netlify runs your build.

### Step 2: Create the MkDocs configuration file

Next, create a file called `mkdocs.yml` in the root directory of your project. This file contains all the necessary settings for your MkDocs site.

Here’s an example of the mkdocs.yml file:

```
site_name: My Projecttheme:  name: materialnav:  - Home: index.md  - About: about.md
```

-   `site_name`: This sets the name of your documentation site. Replace `"My Project"` with your project’s name.
-   `theme`: We are using the Material theme for MkDocs here, which provides a modern and clean design for your documentation.
-   `nav`: This sets up the navigation structure for your site. In this case, we have two pages: `Home` and `About`, which we’ll define in the next step.

### Step 3: Create your documentation pages

Now, let’s create the actual content for your site. Inside your project directory, create a folder called `docs`. This folder will contain your Markdown files that MkDocs will use to generate the site.

In the `docs/` folder, create two Markdown files:

1.  `index.md` for the homepage:
    
    ```
    # Welcome to My Project
    This is the home page for your documentation.
    ```
    
2.  `about.md` for the “About” page:
    
    ```
    # About My Project
    This page gives more information about the project.
    ```
    

These Markdown files are automatically rendered as HTML by MkDocs, and the navigation structure you set up in the `mkdocs.yml` file will link to these pages.

### Step 4: Configure Netlify for deployment

To deploy your MkDocs site on Netlify, you need to configure the build settings.

In the root of your project, create a `netlify.toml` file with the following content:

```
[build]  command = "mkdocs build"  publish = "site/"  environment = { PYTHON_VERSION = "3.13" }
```

-   `command`: This tells Netlify to run the `mkdocs build` command, which generates the static files for your documentation site.
-   `publish`: MkDocs outputs the static site in the `site/` folder by default, so we specify that as the directory to publish.
-   `environment`: Here, we set the Python version to `3.13` to benefit from the latest version.

### Step 5: Deploy to Netlify

You’re now ready to deploy your MkDocs site! Push your project to a Git repository (e.g., GitHub, GitLab, or Bitbucket), and connect it to Netlify.

### Step 6: Customize and expand your documentation

Now that your MkDocs site is live, you can continue adding new documentation pages by simply creating more `.md` files in the `docs/` folder and updating the navigation structure in `mkdocs.yml`.

## Wrapping up

With just a few simple steps, you’ve successfully deployed a flexible documentation site powered by MkDocs on Netlify. By using the `mkdocs.yml` file for configuration and Markdown files for content, MkDocs makes it easy to manage and scale your documentation over time.

If you want to learn more about MkDocs or dive deeper into customizations, check out the [MkDocs documentation](https://www.mkdocs.org/getting-started/).

Happy documenting and deploying!

### Share

-   [X (fka Twitter)](https://twitter.com/intent/tweet?text=Announcing configurable Python versions in Netlify builds&url=https://www.netlify.com/blog/announcing-configurable-python-versions-in-netlify-builds/)
-   [LinkedIn](https://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Fwww.netlify.com%2Fblog%2Fannouncing-configurable-python-versions-in-netlify-builds%2F)
-   [Facebook](https://www.facebook.com/sharer.php?u=https://www.netlify.com/blog/announcing-configurable-python-versions-in-netlify-builds/)
-   [Bluesky](https://bsky.app/intent/compose?text=Announcing configurable Python versions in Netlify builds+https://www.netlify.com/blog/announcing-configurable-python-versions-in-netlify-builds/)

* * *

### Tags

-   [Python](/blog/tags/python/)
-   [Build](/blog/tags/Build/)
-   [environment variables](/blog/tags/environment-variables/)
-   [changelog](/blog/tags/changelog/)

## Keep reading

![](/_astro/eb275ddb9290b947ba4c53ac30538c77b44edae9-720x405_1y2MXK.webp)

News & Announcements June 25, 2026

[

### Netlify Functions, designed for Agent Experience

](/blog/netlify-functions-designed-for-agent-experience)

-   ![Profile picture of Eduardo Bouças](/_astro/52958f21e8450baf6d8e60302341a984e220c0cd-512x512_13VDlu.webp)
    
    Eduardo Bouças
    

![](/_astro/d20f9f717bbdd511f73ee138be4114ff13f480f9-2400x1350_1fe4aq.webp)

News & Announcements June 24, 2026

[

### How we measure Netlify’s Agent Experience

](/blog/how-we-measure-netlify-agent-experience)

-   ![Profile picture of Sean Roberts](/_astro/bbf2243f8171dbddd80ab2103622106cef84d125-512x512_Z1d2LKE.webp)
    
    Sean Roberts
    

## Recent posts

News & Announcements June 25, 2026

[

### Netlify Functions, designed for Agent Experience

](/blog/netlify-functions-designed-for-agent-experience)

-   ![Profile picture of Eduardo Bouças](/_astro/52958f21e8450baf6d8e60302341a984e220c0cd-512x512_13VDlu.webp)
    
    Eduardo Bouças
    

News & Announcements June 24, 2026

[

### How we measure Netlify’s Agent Experience

](/blog/how-we-measure-netlify-agent-experience)

-   ![Profile picture of Sean Roberts](/_astro/bbf2243f8171dbddd80ab2103622106cef84d125-512x512_Z1d2LKE.webp)
    
    Sean Roberts
    

Guides & Tutorials May 15, 2026

[

### How to build a real-time AI chatbot in minutes with Netlify Agent Runners (no backend)

](/blog/how-to-build-a-real-time-ai-chatbot-in-minutes-with-netlify-agent-runners-no-backend)

-   ![Profile picture of Nahrin Jalal](/_astro/f0e7c8f227a03fe58340c99ef5439d5a896c0733-272x272_Z23kDpD.webp)
    
    Nahrin Jalal
    

![](/_astro/3f255b372fa958df35802666ee33b4609b2d71bd-1200x1586_1VtE2D.webp)

### How do the best dev and marketing teams work together?

[Access the report](https://www.netlify.com/reports/2024-leadership-trend-report/access/)