Using PIP in a Azure WebApp(在 Azure WebApp 中使用 PIP)
问题描述
我是 Azure 的新手,我正在尝试启动并运行 Django WebApp.我使用 FTP 上传了文件,但 Azure 没有运行我的 requirements.txt
.
于是搜索了一下,发现可以用pip安装requirements.txt
.
回到 Azure,PIP 似乎不起作用.不在控制台、KUDU CMD 或 KUDU powershell 中.Python 确实有效.
当我尝试通过 Python 安装 PIP 时,它首先说已经安装了旧版本.当 Python 尝试升级 PIP 时,它无权访问它需要编辑的文件夹.
我想知道如何在 azure 中使用 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.txt
with 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.
envscriptspython -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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:在 Azure WebApp 中使用 PIP
基础教程推荐
- 使用PyInstaller后在Windows中打开可执行文件时出错 2022-01-01
- Python kivy 入口点 inflateRest2 无法定位 libpng16-16.dll 2022-01-01
- Dask.array.套用_沿_轴:由于额外的元素([1]),使用dask.array的每一行作为另一个函数的输入失败 2022-01-01
- 如何让 python 脚本监听来自另一个脚本的输入 2022-01-01
- 用于分类数据的跳跃记号标签 2022-01-01
- 在 Python 中,如果我在一个“with"中返回.块,文件还会关闭吗? 2022-01-01
- 何时使用 os.name、sys.platform 或 platform.system? 2022-01-01
- 线程时出现 msgbox 错误,GUI 块 2022-01-01
- 筛选NumPy数组 2022-01-01
- 如何在海运重新绘制中自定义标题和y标签 2022-01-01