ERROR: Could not find a version that satisfies the requirement azure-functions

Viewed 3154

I have been doing this exercise:

Create a function in Azure using Visual Studio Code

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

After doing the following steps:

  • Select a language for your function project: Choose Python.

  • Select a Python alias to create a virtual environment: Choose the location of your Python interpreter. If the location isn't shown, type in the full path to your Python binary.

  • Select a template for your project's first function: Choose HTTP trigger.

  • Provide a function name: Type HttpExample.

  • Authorization level: Choose Anonymous, which enables anyone to call your function endpoint. To learn about authorization level, see Authorization keys.

  • Select how you would like to open your project: Choose Add to workspace.


I press F5 to Run the function locally

And this is the error I get:

enter image description here

I have python, pip, wheel, azure-function tools installed

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)

Operating System: Microsoft Windows 10 Education 10.0.19041 Build 19041

How do I get this problem solved? Please help

Tried this as well:

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

I just want that error gone so that I can complete the rest of the exercise.

(I have posted this issue on my GitHub Repository as well if incase you can tag someone from the #azure-functions team on my GitHub Issue)

1 Answers

@aprilspeight helped me solve this issue. So this issue can be closed.

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

The whole issue can be read HERE

Related