How to use python 3.10

how do i use python 3.10
because everytime i deploy my site it uses python 2.7

hi there, did you set a python version as described in our docs?

that would e the first thing to try. let us know if it still doesnt work once you have tried this.

it worked thanks
the website is running but now it saying page not found

Hi there,

Did you see this guide yet? This is the best place to start for “Page Not Found” issues.

If you are still seeing issues after following the troubleshooting steps in there, please check out this Support Guide as well. It outlines all of our build and deploy resources and will get you on the right track :slight_smile:

If none of the above resources help, please write back with your site name and what steps you have tried and we can look into this further!

Is it working?
I’ve just tried with runtime.txt with 3.10 but it fails:

The linked page says that it supports only 3.8 and 2.7.

1 Like

Hey @achimnol,

Yes, unfortunately, we only support up to Python 3.8 at the moment.

You can find Netlify’s supported Python version here.

Please support Python 3.9, 3.10, and 3.11. Not having support causes us substantial difficulty. Libraries our builds depend upon often use features available in newer Python versions.

Python 3.8 is about a year from end of life support and the other versions have been generally available for long periods of time. Python 3.9 was released nearly 3 years ago.

Based on the click counter to the link in your post @ben519 and questions in this forum and elsewhere on the internet, it appears many folks are interested in using newer Python versions.

Please prioritize this work so that we can continue to be Netlify customers.

1 Like

We’ve shared this wit the devs. Unfortunately, there are no further updates at this point.

Is there any update on the topic? Given the fact that support for python 3.8 ends in October this year (in a mere 6 months) and recent python version had major changes to supported features, it would be nice to be able to upgrade the python version.
Major libraries also dropped support for 3.8 already, and more will follow. Meaning we are stuck on an old stack.
Can you maybe get an ETA for the support of new versions?

1 Like

When can we expect to receive support for Python versions >=3.10? It’s not possible to work with some python resources without having support for newer versions and I am clueless as to how to continue in this case

I tried setting an environment variable for Python 3.12. Previously I had Python 3.8 and that worked, but Python 3.12 fails.

netlify.toml:

[build.environment]
  PYTHON_VERSION = "3.12"

Deploy log:

/opt/build-bin/run-build-functions.sh: line 380: /opt/buildhome/python3.12/bin/activate: No such file or directory
Error setting python version from the PYTHON_VERSION environment variable
Please see https://github.com/netlify/build-image/blob/focal/included_software.md for current versions
Failing build: Failed to install dependencies

I can’t wait around for Netlify to adopt Python 3.8 because our project dependencies—including Sphinx, Sphinx Book Theme, and PyData Sphinx Theme—now require Python 3.9 (preferably 3.11 or later). I tried alternative preview builders—including Cloudflare Pages, Vercel, and Read the Docs—and documented my experience with them in Create preview build · Issue #4 · plone/plone-sphinx-theme · GitHub. It’s unfortunate that I need to migrate from Netlify.

Hi Netlify Team,

If you do not have any intention of supporting a new Python version then what alternatives do you suggest?

Installing the required version of Python is going to eat up build minutes and I cannot keep running my website on an ancient version of Python.

Python 3.8 support ended 5 days ago (Python | endoflife.date)

The Netlify error message I get when trying to use 3.11 and 3.12 still points me to build-image/included_software.md at focal · netlify/build-image · GitHub which has been archived since January 2023, but I assume is still representative

Does anyone have a workaround to be able to use a modern Python? My attempts to do it via build command haven’t worked out so far

Thanks