Hello @BTCElectrician
Let's try to troubleshoot this issue together.
Firstly, it's good to know that Azure Functions currently supports Python versions 3.6, 3.7, 3.8, and 3.9. Python 3.11 is not yet supported, so that could be the reason why your function is defaulting to Python 3.9.
If you have confirmed that your Azure Function App is running on a Linux-based Consumption Plan (Y1), which supports Python 3.11, then it's possible that the Python 3.11 runtime is not yet available on the worker that your function is running on.
You can check the worker version by looking at the Current sys.path
in the error message you provided.
If the worker version is not 3.11, then you may need to wait until the worker is updated to support Python 3.11.
Another thing to check is the FUNCTIONS_WORKER_RUNTIME
setting in your Azure Function App's Configuration settings.
Make sure that it is set to python
and not python-3.9
.
This could be causing your function to default to Python 3.9.
Lastly, the error message you provided indicates that there is a missing module named 'openai'. Make sure that this module is included in your requirements.txt file and that it is installed in your function's environment. You can check the installed packages by looking at the Current sys.path
in the error message.
I hope that this response has addressed your query and helped you overcome your challenges. If so, please mark this response as Answered. This will not only acknowledge our efforts, but also assist other community members who may be looking for similar solutions.