简体   繁体   中英

Python version on Azure app service mismatch the python version on MacOS

I created a new app service on my Azure account. When I created the app service I choose that I want it to run Python 3.9 (The newest version possible). I enter the configuration menu on my app service and I saw it run Python 3.9 I created my app and now I want to deploy it to the Azure app service, but when I enter to azure kudu command line, I enter the BASH command line typed "python -V" I get "Python 2.7.16" and python3 -VI get "Python 3.7.3"

The problem Is I developed my app on my mac which is Python "3.9.12". Should I downgrade the python on my Mac?

How do I do this?

Thank you, Tal

  • I have created python 3.9.12 and deployed to azure from VS Code MAC OS
  • Even I am getting the Python version as 2.7.16 in Bash.

在此处输入图像描述

  • If I check the version in Azure CLI, got the latest 3.9 version by using the below command.

在此处输入图像描述

az webapp config show --resource-group YourRGName --name YourWebAppName --query linuxFxVersion
  • The version which I got with Azure CLI command is the exact version which my Azure App Service is using.

  • We can change the python version in Azure portal.

  • For Windows app service there is an Extensions option, but for Linux app service it is disabled.在此处输入图像描述

  • For Linux app service run the below command to update the version from Azure CLI

az webapp config set --resource-group YourRGName --name YourWebAppName --linux-fx-version "PYTHON|3.9"

Should I downgrade the python on my Mac?

If you can use the older version, you can downgrade your python version. If you want to use only the latest version, then update the python version in Azure Web App in Portal which I have mentioned in previous steps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM