Python Function App - VSCode environment

JB 21 Reputation points
2020-08-19T16:45:35.287+00:00

New to creating a Function App with Python and new to the VSCode environment.

I've been following: https://learn.microsoft.com/en-us/azure/developer/python/tutorial-vs-code-serverless-python-01#:~:text=In%20this%20article%2C%20you%20use%20Visual%20Studio%20Code,a%20virtual%20machine%20or%20publish%20a%20web%20app.

to set up a test and I'm to the point of debugging and the Terminal shows the following error and I'm not sure where to go.

Executing task: .venv\Scripts\python -m pip install -r requirements.txt <

'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
/d : The term '/d' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1

  • /d /c .venv\Scripts\python -m pip install -r requirements.txt
  • ~~
  • CategoryInfo : ObjectNotFound: (/d:String) [], CommandNotFoundException
  • FullyQualifiedErrorId : CommandNotFoundException
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,933 questions
0 comments No comments
{count} votes

Accepted answer
  1. Ryan Hill 30,281 Reputation points Microsoft Employee Moderator
    2020-08-20T03:55:31.93+00:00

    @JB my bet is that there's an issue with your virtual environment. When you created the folder, you're presented with the option to select an interpreter. This will scaffold the python virtual environment for you. The task being executed is being ran locally from the .venv folder.

    18900-2020-08-19-23-37-23-vs-code-python.png

    To verify, you can open the command palette and type python and confirm your interpreter is set to your .venv. If you don't see your virtual environment, then you can follow these steps to reinstall and configure python for your environment. Clicking on Activate.ps1 will execute the powershell script, setting your terminal prompt to the virtual environment, the (.venv). Check for any errors by running python --version or python -m pip install -r requriements.txt and if you see any, post them in a comment below.

    18839-2020-08-19-23-42-41-vs-code-python.png


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.