Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using PIP in a Azure WebApp

I'm pretty new to Azure and I'm trying to get a Django WebApp up and running. I uploaded the files using FTP, But Azure doesn't run my requirements.txt.

So I searched for a bit and found out that you can install the requirements.txtwith pip.

Back in Azure, PIP doesn't seem to work. Neither in the Console, The KUDU CMD or the KUDU powershell. Python does work.
When I try to install PIP via Python, it first says that a older version is already installed. When Python tries to upgrade PIP, it doesn't have access to the folder that it needs to edit.

I was wondering how I could use PIP in azure.
(If you know a seperate way to install the requirements.txt please tell, because this was how I originally came to this point.)

like image 880
Nathan Avatar asked Jan 09 '16 10:01

Nathan


2 Answers

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

python -m easy_install --upgrade --user pip

like image 72
justint Avatar answered Nov 15 '22 00:11

justint


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.

like image 2
AJ91 Avatar answered Nov 15 '22 02:11

AJ91