0

I'm trying to install azure-cli in my app service using python pip install but Im getting an error.


You are using pip version 9.0.3, however version 21.1.3 is available.

You should consider upgrading via the 'python -m pip install --upgrade pip' command.

I've tried the recommendation but it does not also work. So I added Python 3.6.4 x64 extension in my app service and installed it. But the console is still using version 2.7.

What I'm missing?

Krzysztof Madej
  • 32,704
  • 10
  • 78
  • 107
Ronald Abellano
  • 774
  • 10
  • 34

1 Answers1

2

Please install an extension on Azure App Service:

enter image description here

Click add and select the one you would like to have:

enter image description here

Then accepts condition. After that you need to change a path and this is shown here in documentation

It can be done via Xdt transform

<?xml version="1.0"?> 
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"> 
  <system.webServer> 
    <runtime xdt:Transform="InsertIfMissing">
      <environmentVariables xdt:Transform="InsertIfMissing">
        <add name="FOO" value="BAR" xdt:Locator="Match(name)" xdt:Transform="InsertIfMissing" />    
        <add name="PATH" value="%PATH%;%HOME%\FolderOnPath" xdt:Locator="Match(name)" xdt:Transform="InsertIfMissing" />    
      </environmentVariables>
    </runtime> 
  </system.webServer> 
</configuration> 

Please check also this question

Krzysztof Madej
  • 32,704
  • 10
  • 78
  • 107
  • I've already done that. The app service C: has Python27 and Python36 folder. Should I delete the Python27 ? – Ronald Abellano Jul 08 '21 at 09:21
  • 1
    Please check it [here](https://learn.microsoft.com/en-us/visualstudio/python/managing-python-on-azure-app-service?view=vs-2019#azure-app-service-kudu-console). So they just navigate to the folder where python is installed. I assume that installing pythin doesn't change the PATH. Maybe [this will help you](https://stackoverflow.com/a/59790740/2347999) – Krzysztof Madej Jul 08 '21 at 09:28
  • 1
    That works! I should navigate to the python364 folder and use python.exe. – Ronald Abellano Jul 08 '21 at 09:38