Using PIP in a Azure WebApp Using PIP in a Azure WebApp django django

Using PIP in a Azure WebApp


Have you tried upgrading pip with easy_install? The following worked for me in Azure kudu console:

python -m easy_install --upgrade --user pip


You won't be able to upgrade the pip of your Django webapp because you will not have access to system files.

Instead you can upgrade pip of your virtualenv, which you can do by adding a line in deploy.cmd file before install requirements.txt command.

env\scripts\python -m pip install --upgrade pip

Remember not to upgrade pip with pip (env/scripts/pip) else it will uninstall global pip.


Based on my understanding, I think you want to create a virtual environment for Python and do some package installation using requirement.txt for a Django WebApp and got some issue.

For Django on Azure WebApp, I recommend creating a WebApp preinstalled Django from gallery on Azure old portal.

However, arccording to the Azure offical document, you also can't install some packages by using pip, please see these cases below.

Some packages may not install using pip when run on Azure. It may simply be that the package is not available on the Python Package Index. It could be that a compiler is required (a compiler is not available on the machine running the web app in Azure App Service).

But you can refer to the offical troubleshooting doc to deal with this issue, please see https://azure.microsoft.com/en-us/documentation/articles/web-sites-python-create-deploy-django-app/#troubleshooting---package-installation.