Python 3.11 or newer

Hello.
Since the repo for build image was archived, I wanted to create a new post on the forum to discuss/follow this suggestion.

It will be pretty interesting and useful to update the Python version of Netlify.

Python 3.11 is quicker, with 20/30% of improvement in speed. Furthermore, using mkdocs, many plugins upgrade to use the syntax and function added in 3.10 & 3.11.

3 Likes

Hi @Mara-li,

The devs are aware of the request and are working on it. As they’ve mentioned, there’s no ETA.

Just FYI, Sphinx has just dropped support for Python 3.8 on their master branch, meaning their next major version release won’t be supported in the current state of the netlify Ubuntu 20.04 based runners:

1 Like

It’s actually been dropped in Sphinx 7.2.0:
https://www.sphinx-doc.org/en/master/changes.html#release-7-2-0-released-aug-17-2023

This means that Sphinx 7.1.2 is the last Sphinx version which is currently supported when using netlify.

Please have a look at updating the runner images with support for newer Python versions. Thank you.

1 Like

Thank you for sharing, @bastimeyer. I’ve passed this to the devs.

+1 this post, 3.11 and newer has improved performance, syntax, typing, etc

having access to it would b so good

Python 3.8 has been in the “security-fix-only” release cycle since 2021-06-28 and will reach its end of support in October 2024:

No idea which 3.8 version netlify includes in its build-images, but considering that no recent Python versions are available, it probably won’t be a recent one either.

Please be aware that lots of projects will stop supporting 3.8 once it’ll be dropped by the Python devs, which is in about half a year. As mentioned in my previous post, Sphinx has already dropped support for 3.8 in its 7.2.0 release, which means that all releases since then (see the link to Sphinx’s changelog above) currently can’t be installed. For us, this means that our netlify builds which we’re using for PR previews on GitHub slowly diverge from our production builds which are hosted on GitHub pages.

Please have a look at providing up-to-date Python environments in your build images, thank you.

I spoke a little more in-depth on this in the post linked below, but to summarize:

  • Python 3.8 is now Unsupported as of this week, with the stable release of 3.13
  • Netlify’s only available Python versions are 3.8 and 2.7 (unsupported since January 2020)
  • There is no current Python version available for use in Netlify builds

Since early last year, I’ve been pretty spoiled by always automatically having the latest Python available when I create a new development container at Gitpod. It’s always a shock to check the runtime.txt file for our FOSS project and remember that it’s still using what was until recently the oldest maintained release of Python (and is now, to repeat, unmaintained).

And I can’t get mkdocs to build anymore. We are on 3.11 and griffe which is required does not run on python 3.8. Kind of make netlify pretty useless. I guess people aren’t using this part of the build system anymore. Too bad, was great for creating document sites. On to Vercel or something else :wink:

Hi everyone,

Thank you all for your feedback and for bringing this to our attention. We completely understand the impact this has had. The good news is that a fix is already in the works, and it’s being rolled out to the uses.

We truly appreciate your patience and understanding, and we’re committed to ensuring your experience with Netlify remains smooth and reliable. Thanks for being part of our community, and we’re excited to get this resolved for you very soon!

We now have PYTHON_VERSION environment variable and we’re also rolling out a version selector in the UI.

1 Like

That’s awesome, @hrishikesh ! My builds are still failing with PYTHON_VERSION set to anything other than 3.8. Is the fix not globally available yet? What python versions will be supported by this fix?

Sorry, it looks like the rollout was reverted:

Hopefully, by next week it should be restored.

We’ve shipped a fix for this, you can now specify any version of Python with the PYTHON_VERSION environment variable!

Let us know if you run into any issues.

1 Like