0

I'm currently building an Azure Function. Currently I'm debugging the script and I've encountered a KeyError 'error in six.moves'. This similar problem suggests that it was a 'badly configured environment', and the solution was to "redo the virtual environment". What would count as a 'well-configured environment'? As far as my understanding goes, all that it has to be is that it meets the version requirements needed, and that no conflicts between dependencies should be present.

I will be attempting to redo my own virtual environment.

  • @PanagiotisKanavos I think it's similar to my case since the linked question is creating an Http-triggered Azure function. I'm creating an Azure function as well, but just a timer-triggered one. Your suggested answer pertains to the `KeyError` problem in general, but it unfortunately doesn't answer my question. – Marvin Joseph Agor Aug 24 '22 at 11:55

1 Answers1

0

Please try the below steps if it helps to fix the issue:

What makes for a well-constructed local environment?

  • Make Sure you run the Azure Function (Python Stack) in virtual environment (.venv) in the Visual Studio Code.
  • Check all the required packages are available in the requirements.txt file.
  • If Virtual environment is not created while creating the Azure Functions Python in VS Code, you can create using the commands in terminal as given in thi s MS Doc.
  • Check the Azure Functions Core Tools version is the latest for the Python Version above 3.6

enter image description here enter image description here

  • Check all the required packages are available by using the command pip list in the VS Code Terminal. enter image description here
  • After that, start the function using the command func host start from the same project terminal in VS Code and check.