在Azure WebApp中使用PIP [英] Using PIP in a Azure WebApp

查看:154
本文介绍了在Azure WebApp中使用PIP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对Azure来说还很陌生,我正在尝试启动并运行Django WebApp.我使用FTP上传文件,但是Azure无法运行我的requirements.txt.

因此,我进行了一些搜索,发现可以使用pip安装requirements.txt.

回到Azure,PIP似乎不起作用.在控制台中,KUDU CMD或KUDU powershell都没有. Python确实有效.
当我尝试通过Python安装PIP时,它首先说已经安装了较旧的版本.当Python尝试升级PIP时,它无权访问需要编辑的文件夹.

我想知道如何在天蓝色时使用PIP.
(如果您知道另外一种安装requirements.txt的方法,请告诉我,因为这是我最初的理解.)

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.)

推荐答案

您将无法升级Django webapp的pip,因为您将无法访问系统文件.

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

相反,您可以升级virtualenv的pip,可以通过在install requirements.txt命令之前在deploy.cmd文件中添加一行来实现.

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

请记住不要使用pip(env/scripts/pip)升级pip,否则它将卸载全局pip.

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

这篇关于在Azure WebApp中使用PIP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆