Skip to content

[FeatureRequest] Support for Python 3.12 #1397

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
aersam opened this issue Jan 15, 2024 · 40 comments
Closed

[FeatureRequest] Support for Python 3.12 #1397

aersam opened this issue Jan 15, 2024 · 40 comments
Assignees

Comments

@aersam
Copy link

aersam commented Jan 15, 2024

Describe the request: A clear and concise description.
Well, make Azure Functions compatible with Python 3.12 :)

@Roman-Ka
Copy link

Hey, are there any updates on this? Any indications of the timelines?

@cmcconomyfwig
Copy link

Python 3.13 was just released into the wild - any work on getting 3.12 into azure functions?

@pykong
Copy link

pykong commented Oct 8, 2024

I am disgruntled about the lack of support for Python 3.12. Az Function now lags two whole versions behind Python stable. Is Microsoft still in touch with its Azure customers who use Python? Please fix this ASAP!

@rmontroy
Copy link

rmontroy commented Oct 9, 2024

Update was merged a while back (Release 4.30.1), but apparently still in progress: #3796.
@gavin-aguiar

@pykong
Copy link

pykong commented Oct 14, 2024

Any update @gavin-aguiar ?

@gavin-aguiar
Copy link
Contributor

@rmontroy @pykong. All the code for python 3.12 has been merged. We are just waiting on the release in all regions. Should take a couple of weeks.

@pykong
Copy link

pykong commented Oct 17, 2024

@gavin-aguiar That sounds good. Thanks for letting us know!

@stevesimmons
Copy link

stevesimmons commented Nov 16, 2024

@gavin-aguiar:

All the code for python 3.12 has been merged. We are just waiting on the release in all regions. Should take a couple of weeks.

Hi Gavin.

Is there any further update for when we can use Azure Functions with Python 3.12? Your message of "a couple of weeks" was a month ago.

And if any of the Microsoft Azure Functions product owners are reading this, you teased the release of Py 3.12 in December 2023 but then went silent on specific target dates while delaying many months longer than the equivalent timeframes for the Py 3.11 rollout*. That's not really fair to customers like me who committed to Azure Functions in their stacks but now fear they'll be stranded on non-current versions. It's also mystifying why you'd deprioritise timely Python support when it just makes Azure Functions less attractive for all kinds of AI/ML workloads.

* Python 3.11 was released on Oct 2022, went into public preview on Azure Functions in July 2023 (+9 months), and GA in September 2023 (+11 months). Python 3.12 was released in Oct 2023. Still no public preview or GA 13 months later. If Microsoft had followed the same cadence as for Py3.11, we'd have had the Py3.12 public preview in July 2024 and GA in September 2024.

@pykong
Copy link

pykong commented Nov 19, 2024

This is some horrible behavior of Azure towards its customers.

@hallvictoria
Copy link
Contributor

hallvictoria commented Nov 20, 2024

Hi, so sorry for the delay, and thanks for your patience with this.

We are currently targeting early to mid-December for 3.12 support to be released. I'll post another update here once it has been finalized.

We understand that this release has been much slower comparatively speaking, and we are actively working to do better for future Python versions.

EDIT: Our updated target for Python 3.12 support is January.

@pykong
Copy link

pykong commented Nov 21, 2024

You'd better start working on Python 3.13 as soon as possible so it will be ready by December 2025.

#1588

@chopeen
Copy link

chopeen commented Nov 29, 2024

Can you please test if the 3.12 runtime works with cryptography v44 (see pyca/cryptography#12064)?

@louij2
Copy link

louij2 commented Jan 6, 2025

Hi, so sorry for the delay, and thanks for your patience with this.

We are currently targeting early to mid-December for 3.12 support to be released. I'll post another update here once it has been finalized.

We understand that this release has been much slower comparatively speaking, and we are actively working to do better for future Python versions.

EDIT: Our updated target for Python 3.12 support is January.

We are in January now, almost one year after this Feature Request was opened. Any update on a specific day for support?

I see it live in the artifact registry but still unable to deploy through the Azure portal. It's now not possible to download a Python 3.11 exe off the shelf to install on Windows so it's impossible to develop new Azure Function Apps for Python in the current state.

@ChrisLoveringSendient
Copy link

ChrisLoveringSendient commented Jan 6, 2025

It's now not possible to download a Python 3.11 exe off the shelf to install on Windows so it's impossible to develop new Azure Function Apps for Python in the current state.

@louij2 You can get an installer here https://www.python.org/downloads/release/python-3119/

Never versions of 3.11 don't have installers as 3.11 is in it's security update only phase, which only ship is source tar balls. If you need newer versions of 3.11, you can use docker containers, or install using https://github.com/pyenv-win/pyenv-win

@jorgeczaiden
Copy link

It's now not possible to download a Python 3.11 exe off the shelf to install on Windows so it's impossible to develop new Azure Function Apps for Python in the current state.

@louij2 You can get an installer here https://www.python.org/downloads/release/python-3119/

Never versions of 3.11 don't have installers as 3.11 is in it's security update only phase, which only ship is source tar balls. If you need newer versions of 3.11, you can use docker containers, or install using https://github.com/pyenv-win/pyenv-win

Once pyenv-win, by default, looks for the official Python FTP, you can't find security update versions for Windows. The only alternatives, as you mentioned, are using Docker containers, WSL, or properly using Linux itself.

@akozhikkot
Copy link

Hi Team,

Could you kindly let us know what is the status of this when this would be rolled out. Our company has stopped letting developers to use python 3.11. So local development is pretty difficult without the support for 3.12 and above

@hallvictoria
Copy link
Contributor

3.12 support has been released. Flex consumption support is still pending, but we plan to have it out soon.

@tm14719
Copy link

tm14719 commented Feb 3, 2025

It seems to be in preview.
When will it be GA?

Image

@BorgPrincess
Copy link

Maybe MS will surprise us all by jumping straight to full 3.13 support. 😉

@polys
Copy link

polys commented Feb 9, 2025

Having support for 3.12 is much appreciated, thank you!

I get Python 3.12.2 on Linux 5.10.102.2-microsoft-standard (Debian GNU/Linux 12 (bookworm) with glibc 2.36)

Is this it or that's only during the preview period?

Python 3.12.9 is out.

@drewpearce
Copy link

Is there any word on when 3.12 will be GA instead of just preview? Trying to do some product planning for my team.

@chopeen
Copy link

chopeen commented Mar 6, 2025

How about the image python:4-python3.12-core-tools? I use the core-tools image to publish the Func App from a CI pipeline. Will it be published before 3.12 is GA?

@ErikApption
Copy link

ErikApption commented Mar 11, 2025

@hallvictoria Could someone throw a bit more light in the 3.12 support even in preview?
There is a docker image mcr.microsoft.com/azure-functions/python:4-python3.12 It deploys correctly and says
Container ... initialized and is ready to serve requests but there are no functions available. I'm unclear what the best path right now is - 3.12 and 44.0.x crypto module or 3.11 with 43.x crypto module that has some security warnings

@hallvictoria
Copy link
Contributor

@polys, the patch version will be updated periodically, depending on the changes and bugfixes added.

@tm14719 / @drewpearce, we are currently targeting GA by end of this month.

@chopeen, the core-tools images will no longer be published. You can reference the Dockerfile directly if needed or use one of the other published 3.12 images.

@ErikApption, our recommendation is to use Python 3.12 and the latest cryptography module. If you're facing more specific issues, please open a separate issue.

@chopeen
Copy link

chopeen commented Mar 18, 2025

I have my project deployed to separate Function Apps with 3.11 and 3.12 runtime respectively. When I open SSH session for both and try checking the Python version, this is what I see:

root@311:/# python --version
Python 3.11.10
root@312:~# python --version
python: error while loading shared libraries: libpython3.12.so.1.0: cannot open shared object file: No such file or directory

The functions seem to be working, but the error is still worrisome. What's causing it?


The file libpython3.12.so.1.0 is available, but Python 3.12 is installed to a different location than the standard one used for 3.11, i.e. /opt/python/3.12.2/. Is this why /opt/python/3.12.2/lib/libpython3.12.so.1.0 cannot be located?

Should I add the path to LD_LIBRARY_PATH, i.e. export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/opt/python/3.12/lib", to the Function App environment variables?

@hallvictoria
Copy link
Contributor

@chopeen this error does not impact your function app behavior, and it was fixed in runtime version 4.1037. 4.1037 is still in the process of rolling out, with ETA of finishing by end of this week

@sepira
Copy link

sepira commented Mar 25, 2025

@hallvictoria Is it safe to move to our function apps to 3.12 now?

@hallvictoria
Copy link
Contributor

@sepira 3.12 is fully supported. We are still targeting end of March / early April for GA

@mithunideas2it
Copy link

@hallvictoria 3.12 is ready for Production ?

@hallvictoria
Copy link
Contributor

@mithunideas2it 3.12 is currently still in preview. It is up to your discretion if you are comfortable migrating now or would prefer to wait until GA.

@CodyKlingler
Copy link

@hallvictoria Is flex consumption supported with 3.12 yet?

Are there any features missing from 3.12 that is preventing it from GA?

@hallvictoria
Copy link
Contributor

@CodyKlingler yes, 3.12 is available on flex.

No, there are no features missing from 3.12 compared to previous versions. We are currently monitoring its adoption and usage to ensure it meets our quality standards for GA.

@cmcconomyfwig
Copy link

@CodyKlingler yes, 3.12 is available on flex.

No, there are no features missing from 3.12 compared to previous versions. We are currently monitoring its adoption and usage to ensure it meets our quality standards for GA.

Hi Victoria,

How is the GA approval progressing? Can we expect this before the end of the month?

@BorgPrincess
Copy link

Hi @hallvictoria ,
just for managing our expectations:
Is there a separate team working on supporting Python 3.13, or will that be begun by the same team once 3.12 is complete?
Just because 3.12 has been out for one and a half years, and we are calendarically closer to 3.14 than to 3.13 now...

@hallvictoria
Copy link
Contributor

@cmcconomyfwig, yes, we are expecting to GA by end of April. I'll post an update here if we hit any delays.

@BorgPrincess, there is a single team for supporting Python in Azure Functions. We have already started the work for supporting 3.13. You can track its status on this issue: #1588

@anime-shed
Copy link

So even with this: Azure/azure-functions-core-tools#3796 merged there are still more things pending, I presume?

@hallvictoria
Copy link
Contributor

Python 3.12 is GA!

@lindeengineering
Copy link

2025-05-06T08:25:38.8631217Z [command]/usr/bin/tar xC /agent/_work/_temp/66ae688d-1c89-48c4-a51d-0e357a22ba4b -f /agent/_work/_temp/python-3.12.10-linux-22.04-x64.tar.gz
2025-05-06T08:25:41.6245700Z 
2025-05-06T08:25:41.6266117Z [command]/usr/bin/bash ./setup.sh
2025-05-06T08:25:41.6365662Z Check if Python hostedtoolcache folder exist...
2025-05-06T08:25:41.6367331Z Creating Python hostedtoolcache folder...
2025-05-06T08:25:41.6377333Z Create Python 3.12.10 folder
2025-05-06T08:25:41.6393640Z Copy Python binaries to hostedtoolcache folder
2025-05-06T08:25:42.1108591Z Create additional symlinks (Required for the UsePythonVersion Azure Pipelines task and the setup-python GitHub Action)
2025-05-06T08:25:42.1159034Z Upgrading pip...
2025-05-06T08:25:42.1170385Z ./python: error while loading shared libraries: libpython3.12.so.1.0: cannot open shared object file: No such file or directory
2025-05-06T08:25:42.1173316Z 

it doesnt seem to work @hallvictoria

@hallvictoria
Copy link
Contributor

Hi @lindeengineering, what runtime version is the app running on? If it is not 4.1037 or later, please restart the app to pick up the latest bits. This was an issue fixed in 4.1037 and does not impact your function app behavior.

If your app is on 4.1037+, and you are still seeing this error or if your function app is failing with an error related to this, please open a separate issue.

@lindeengineering
Copy link

lindeengineering commented May 7, 2025

Hi @hallvictoria, the snippet is coming from Azure DevOps pipeline. There is no runtime version selectable, the azure pipeline agent is the latest one v4.255.0

I have updated the vm scale set now to ubuntu24,04, but it fails now with this error:

2025-05-07T04:30:53.1381665Z ##[section]Starting: Use Python 3.12.3
2025-05-07T04:30:53.1386755Z ==============================================================================
2025-05-07T04:30:53.1386902Z Task         : Use Python version
2025-05-07T04:30:53.1386978Z Description  : Use the specified version of Python from the tool cache, optionally adding it to the PATH
2025-05-07T04:30:53.1387120Z Version      : 0.248.1
2025-05-07T04:30:53.1387192Z Author       : Microsoft Corporation
2025-05-07T04:30:53.1387272Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/tool/use-python-version
2025-05-07T04:30:53.1387418Z ==============================================================================
2025-05-07T04:30:54.9202094Z ##[warning]Specifying an exact version is not recommended on Microsoft-Hosted agents. Patch versions of Python can be replaced by new ones on Hosted agents without notice, which will cause builds to fail unexpectedly. It is recommended to specify only major or major and minor version (Example: `3` or `3.9`)
2025-05-07T04:30:54.9205580Z ##[warning]You should provide GitHub token if you want to download a python release. Otherwise you may hit the GitHub anonymous download limit.
2025-05-07T04:30:55.0366277Z Downloading: https://github.com/actions/python-versions/releases/download/3.12.3-11057844995/python-3.12.3-linux-24.04-x64.tar.gz
2025-05-07T04:30:56.4298043Z Extracting archive
2025-05-07T04:30:56.4316555Z [command]/usr/bin/tar xC /agent/_work/_temp/2393a553-7e54-4564-b3d7-26f62db303b9 -f /agent/_work/_temp/python-3.12.3-linux-24.04-x64.tar.gz
2025-05-07T04:30:59.2336093Z 
2025-05-07T04:30:59.2355116Z [command]/usr/bin/bash ./setup.sh
2025-05-07T04:30:59.2444704Z Check if Python hostedtoolcache folder exist...
2025-05-07T04:30:59.2445531Z Creating Python hostedtoolcache folder...
2025-05-07T04:30:59.2456385Z Create Python 3.12.3 folder
2025-05-07T04:30:59.2471694Z Copy Python binaries to hostedtoolcache folder
2025-05-07T04:30:59.7403206Z Create additional symlinks (Required for the UsePythonVersion Azure Pipelines task and the setup-python GitHub Action)
2025-05-07T04:30:59.7449189Z Upgrading pip...
2025-05-07T04:31:15.3727322Z Looking in links: /tmp/tmp2vzi5_hf
2025-05-07T04:31:18.8006009Z Processing /tmp/tmp2vzi5_hf/pip-24.0-py3-none-any.whl
2025-05-07T04:31:18.8193545Z Installing collected packages: pip
2025-05-07T04:31:29.3358781Z Successfully installed pip-24.0
2025-05-07T04:31:29.4445554Z /agent/_work/_tool/Python/3.12.3/x64/bin/python: No module named pip
2025-05-07T04:31:29.4487579Z 
2025-05-07T04:31:29.4505114Z ##[error]Failed to download Python from the Github Actions python registry (https://github.com/actions/python-versions). Error: Error: The process '/usr/bin/bash' failed with exit code 1
2025-05-07T04:31:29.4546051Z ##[error]Version spec 3.12.3 for architecture x64 did not match any version in Agent.ToolsDirectory.
Versions in /agent/_work/_tool:


If this is a Microsoft-hosted agent, check that this image supports side-by-side versions of Python at https://aka.ms/hosted-agent-software.
If this is a self-hosted agent, see how to configure side-by-side Python versions at https://go.microsoft.com/fwlink/?linkid=871498.
2025-05-07T04:31:29.4588000Z ##[section]Finishing: Use Python 3.12.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests