错误:找不到满足azurefunctions要求的版本

2024-10-05 10:22:51 发布

您现在位置:Python中文网/ 问答频道 /正文

我一直在做这个练习:

使用Visual Studio代码在Azure中创建函数

https://docs.microsoft.com/en-us/azure/azure-functions/functions-create-first-function-vs-code?pivots=programming-language-python

执行以下步骤后:

  • 为函数项目选择语言:选择Python

  • 选择Python别名以创建虚拟环境:选择Python解释器的位置。如果未显示位置,请键入Python二进制文件的完整路径

  • 为项目的第一个函数选择模板:选择HTTP触发器

  • 提供函数名:键入HttpExample

  • 授权级别:选择匿名,这使任何人都可以调用您的函数端点。要了解授权级别,请参阅授权密钥

  • 选择打开项目的方式:选择“添加到工作区”


我按F5本地运行该功能

这就是我得到的错误:

enter image description here

我已经安装了python、pip、wheel和azure函数工具

PS C:\Users\Mustafa Saifee\azfunc> python --version
Python 3.8.2

PS C:\Users\Mustafa Saifee\azfunc> pip --version
pip 20.1 from c:\program files\python38\lib\site-packages\pip (python 3.8)

PS C:\Users\Mustafa Saifee\azfunc> wheel version
wheel 0.34.2

PS C:\Users\Mustafa Saifee\azfunc> pip install azure-functions 
Requirement already satisfied: azure-functions in c:\program files\python38\lib\site-packages (1.2.1)

操作系统:Microsoft Windows 10 Education 10.0.19041 Build 19041

我如何解决这个问题?请帮助

我也试过:

I tried python 3.7 and 3.8 plus I also tried it with the conda based python. Then I uninstalled everything. And one by one installed it back. Still the issue persists

我只想让那个错误消失,这样我就可以完成剩下的练习了

(我已经在我的GitHub Repository上发布了这个问题,如果你可以在我的GitHub Issue上标记来自#azure功能团队的人的话)


Tags: pip项目函数功能键入version级别functions
1条回答
网友
1楼 · 发布于 2024-10-05 10:22:51

@aprilspeight帮助我解决了这个问题。所以这个问题可以解决

The solution is given by @aprilspeight: Have you tried running the function while the init.py file is active on the screen?

There shouldn't be a need to modify anything in the function.json file if you're trying out the Quickstart. Therefore, ensure that you're looking at the init.py file when you Start Debugging (F5).

整个问题可以理解为HERE

相关问题 更多 >

    热门问题