Azure-docs: Unable to Verify Python Version

Created on 27 Jun 2019  Â·  5Comments  Â·  Source: MicrosoftDocs/azure-docs

Has anyone come across "unable to verify python version. Please make sure you have Python 3.6 installed" when following the doc at https://docs.microsoft.com/en-us/azure/azure-functions/functions-create-first-function-python

When I try to publish the app, I get the error.
Python is installed and I've verified by py --version

C:\Users\azureAdmin>py --version
Python 3.6.8

Capture


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

azure-functionsvc cxp product-question triaged

All 5 comments

Thanks for your comment. We are actively investigating and will get back to you shortly. Thanks for your patience.

@jcanose81 Python Functions run on Python virtual environment - based on the screenshot that you have provided, it doesn't look like you have activated one per this step.

Thank you for the feedback. I'm following the instructions to the T on the website, but one thing I've had to do is use PowerShell for everything. CMD or Bash won't accept my commands. Please see output below from PowerShell.

In the output below, am I still not activating a python virtual env?

Note: some errors in spelling on my part in "MyFunctionProj" and initial "py -3.6" command

In the step where I have to use Bash, that is where I am getting the python not installed error.

Thank you,

Windows PowerShell
Copyright (C) 2016 Microsoft Corporation. All rights reserved.

PS C:\Users\azureAdmin> python3.6 -m venv .venv
python3.6 : The term 'python3.6' 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

  • python3.6 -m venv .venv
  • ~~~~~

    • CategoryInfo : ObjectNotFound: (python3.6:String) [], CommandNotFoundException

    • FullyQualifiedErrorId : CommandNotFoundException

PS C:\Users\azureAdmin> py -3.6 -m venv .venv
PS C:\Users\azureAdmin> py -3.6 -m venv .venv
PS C:\Users\azureAdmin> .venv\scripts\activate
(.venv) PS C:\Users\azureAdmin> func init MyFunctionPorj
Select a worker runtime: python
Writing .funcignore
Writing .gitignore
Writing host.json
Writing local.settings.json
Writing C:\Users\azureAdmin\MyFunctionPorj.vscode\extensions.json
(.venv) PS C:\Users\azureAdmin> cd MyFunctionProj
cd : Cannot find path 'C:\Users\azureAdmin\MyFunctionProj' because it does not exist.
At line:1 char:1

  • cd MyFunctionProj
  • ~~~~~

    • CategoryInfo : ObjectNotFound: (C:\Users\azureAdmin\MyFunctionProj:String) [Set-Location], ItemNotFound

      Exception

    • FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.SetLocationCommand

(.venv) PS C:\Users\azureAdmin> cd MyFunctionPorj
(.venv) PS C:\Users\azureAdmin\MyFunctionPorj> func new
Select a template: HTTP trigger
Function name: [HttpTrigger] HttpTrigger
Writing C:\Users\azureAdmin\MyFunctionPorj\HttpTrigger__init__.py
Writing C:\Users\azureAdmin\MyFunctionPorj\HttpTrigger\function.json
The function "HttpTrigger" was created successfully from the "HTTP trigger" template.
(.venv) PS C:\Users\azureAdmin\MyFunctionPorj> func host start

              %%%%%%
             %%%%%%
        @   %%%%%%    @
      @@   %%%%%%      @@
   @@@    %%%%%%%%%%%    @@@
 @@      %%%%%%%%%%        @@
   @@         %%%%       @@
     @@      %%%       @@
       @@    %%      @@
            %%
            %

Azure Functions Core Tools (2.7.1373 Commit hash: cd9bfca26f9c7fe06ce245f5bf69bc6486a685dd)
Function Runtime Version: 2.0.12507.0
[7/5/2019 4:11:45 AM] Starting Rpc Initialization Service.
[7/5/2019 4:11:45 AM] Initializing RpcServer
[7/5/2019 4:11:45 AM] Building host: startup suppressed:False, configuration suppressed: False
[7/5/2019 4:11:45 AM] Initializing Host.
[7/5/2019 4:11:45 AM] Host initialization: ConsecutiveErrors=0, StartupCount=1
[7/5/2019 4:11:45 AM] LoggerFilterOptions
[7/5/2019 4:11:45 AM] {
[7/5/2019 4:11:45 AM] "MinLevel": "None",
[7/5/2019 4:11:45 AM] "Rules": [
[7/5/2019 4:11:45 AM] {
[7/5/2019 4:11:45 AM] "ProviderName": null,
[7/5/2019 4:11:45 AM] "CategoryName": null,
[7/5/2019 4:11:45 AM] "LogLevel": null,
[7/5/2019 4:11:45 AM] "Filter": "b__0"
[7/5/2019 4:11:45 AM] },
[7/5/2019 4:11:45 AM] {
[7/5/2019 4:11:45 AM] "ProviderName": "Microsoft.Azure.WebJobs.Script.WebHost.Diagnostics.SystemLoggerProvider",
[7/5/2019 4:11:45 AM] "CategoryName": null,
[7/5/2019 4:11:45 AM] "LogLevel": "None",
[7/5/2019 4:11:45 AM] "Filter": null
[7/5/2019 4:11:45 AM] },
[7/5/2019 4:11:45 AM] {
[7/5/2019 4:11:45 AM] "ProviderName": "Microsoft.Azure.WebJobs.Script.WebHost.Diagnostics.SystemLoggerProvider",
[7/5/2019 4:11:45 AM] "CategoryName": null,
[7/5/2019 4:11:45 AM] "LogLevel": null,
[7/5/2019 4:11:45 AM] "Filter": "b__0"
[7/5/2019 4:11:45 AM] }
[7/5/2019 4:11:45 AM] ]
[7/5/2019 4:11:45 AM] }
[7/5/2019 4:11:45 AM] FunctionResultAggregatorOptions
[7/5/2019 4:11:45 AM] {
[7/5/2019 4:11:45 AM] "BatchSize": 1000,
[7/5/2019 4:11:45 AM] "FlushTimeout": "00:00:30",
[7/5/2019 4:11:45 AM] "IsEnabled": true
[7/5/2019 4:11:45 AM] }
[7/5/2019 4:11:45 AM] SingletonOptions
[7/5/2019 4:11:45 AM] {
[7/5/2019 4:11:45 AM] "LockPeriod": "00:00:15",
[7/5/2019 4:11:45 AM] "ListenerLockPeriod": "00:00:15",
[7/5/2019 4:11:45 AM] "LockAcquisitionTimeout": "10675199.02:48:05.4775807",
[7/5/2019 4:11:45 AM] "LockAcquisitionPollingInterval": "00:00:05",
[7/5/2019 4:11:45 AM] "ListenerLockRecoveryPollingInterval": "00:01:00"
[7/5/2019 4:11:45 AM] }
[7/5/2019 4:11:45 AM] Starting JobHost
[7/5/2019 4:11:45 AM] Starting Host (HostId=azuretest-1452989547, InstanceId=31e0b648-7fb0-4f12-8309-b848d5f56879, Versi
on=2.0.12507.0, ProcessId=9368, AppDomainId=1, InDebugMode=False, InDiagnosticMode=False, FunctionsExtensionVersion=)
[7/5/2019 4:11:45 AM] Loading functions metadata
[7/5/2019 4:11:45 AM] 1 functions loaded
[7/5/2019 4:11:46 AM] Starting language worker process:python "C:\Users\azureAdmin\AppData\Roaming\npm\node_modules\azu
re-functions-core-tools\bin\workerspython\worker.py" --host 127.0.0.1 --port 54321 --workerId 6651aa75-28ab-44b3-92c4-8
e1b1042b216 --requestId ef35a932-27ba-40f0-8f72-f94d45a47cec --grpcMaxMessageLength 134217728
[7/5/2019 4:11:46 AM] python process with Id=5860 started
[7/5/2019 4:11:46 AM] Generating 1 job function(s)
[7/5/2019 4:11:46 AM] Found the following functions:
[7/5/2019 4:11:46 AM] Host.Functions.HttpTrigger
[7/5/2019 4:11:46 AM]
[7/5/2019 4:11:46 AM] Host initialized (255ms)
[7/5/2019 4:11:46 AM] Host started (271ms)
[7/5/2019 4:11:46 AM] Job host started
Hosting environment: Production
Content root path: C:\Users\azureAdmin\MyFunctionPorj
Now listening on: http://0.0.0.0:7071
Application started. Press Ctrl+C to shut down.

Http Functions:

    HttpTrigger: [GET,POST] http://localhost:7071/api/HttpTrigger

[7/5/2019 4:11:47 AM] INFO: Starting Azure Functions Python Worker.
[7/5/2019 4:11:47 AM] INFO: Worker ID: 6651aa75-28ab-44b3-92c4-8e1b1042b216, Request ID: ef35a932-27ba-40f0-8f72-f94d45
a47cec, Host Address: 127.0.0.1:54321
[7/5/2019 4:11:47 AM] INFO: Successfully opened gRPC channel to 127.0.0.1:54321
[7/5/2019 4:11:47 AM] INFO: Received WorkerInitRequest, request ID ef35a932-27ba-40f0-8f72-f94d45a47cec
[7/5/2019 4:11:47 AM] INFO: Received FunctionLoadRequest, request ID: ef35a932-27ba-40f0-8f72-f94d45a47cec, function ID
: b42af63a-e195-484b-897e-13acb84c03ce
[7/5/2019 4:11:48 AM] INFO: Successfully processed FunctionLoadRequest, request ID: ef35a932-27ba-40f0-8f72-f94d45a47ce
c, function ID: b42af63a-e195-484b-897e-13acb84c03ce
[7/5/2019 4:11:51 AM] Host lock lease acquired by instance ID '000000000000000000000000DC83C698'.
[7/5/2019 4:20:00 AM] Directory change of type 'Created' detected for 'C:\Users\azureAdmin\MyFunctionPorj.python_packag
es'
[7/5/2019 4:20:00 AM] Host configuration has changed. Signaling restart
[7/5/2019 4:20:01 AM] Restarting host.
[7/5/2019 4:20:01 AM] Building host: startup suppressed:False, configuration suppressed: False
[7/5/2019 4:20:01 AM] Initializing Host.
[7/5/2019 4:20:01 AM] Host initialization: ConsecutiveErrors=0, StartupCount=2
[7/5/2019 4:20:01 AM] LoggerFilterOptions
[7/5/2019 4:20:01 AM] {
[7/5/2019 4:20:01 AM] "MinLevel": "None",
[7/5/2019 4:20:01 AM] "Rules": [
[7/5/2019 4:20:01 AM] {
[7/5/2019 4:20:01 AM] "ProviderName": null,
[7/5/2019 4:20:01 AM] "CategoryName": null,
[7/5/2019 4:20:01 AM] "LogLevel": null,
[7/5/2019 4:20:01 AM] "Filter": "b__0"
[7/5/2019 4:20:01 AM] },
[7/5/2019 4:20:01 AM] {
[7/5/2019 4:20:01 AM] "ProviderName": "Microsoft.Azure.WebJobs.Script.WebHost.Diagnostics.SystemLoggerProvider",
[7/5/2019 4:20:01 AM] "CategoryName": null,
[7/5/2019 4:20:01 AM] "LogLevel": "None",
[7/5/2019 4:20:01 AM] "Filter": null
[7/5/2019 4:20:01 AM] },
[7/5/2019 4:20:01 AM] {
[7/5/2019 4:20:01 AM] "ProviderName": "Microsoft.Azure.WebJobs.Script.WebHost.Diagnostics.SystemLoggerProvider",
[7/5/2019 4:20:01 AM] "CategoryName": null,
[7/5/2019 4:20:01 AM] "LogLevel": null,
[7/5/2019 4:20:01 AM] "Filter": "b__0"
[7/5/2019 4:20:01 AM] }
[7/5/2019 4:20:01 AM] ]
[7/5/2019 4:20:01 AM] }
[7/5/2019 4:20:01 AM] FunctionResultAggregatorOptions
[7/5/2019 4:20:01 AM] {
[7/5/2019 4:20:01 AM] "BatchSize": 1000,
[7/5/2019 4:20:01 AM] "FlushTimeout": "00:00:30",
[7/5/2019 4:20:01 AM] "IsEnabled": true
[7/5/2019 4:20:01 AM] }
[7/5/2019 4:20:01 AM] SingletonOptions
[7/5/2019 4:20:01 AM] {
[7/5/2019 4:20:01 AM] "LockPeriod": "00:00:15",
[7/5/2019 4:20:01 AM] "ListenerLockPeriod": "00:00:15",
[7/5/2019 4:20:01 AM] "LockAcquisitionTimeout": "10675199.02:48:05.4775807",
[7/5/2019 4:20:01 AM] "LockAcquisitionPollingInterval": "00:00:05",
[7/5/2019 4:20:01 AM] "ListenerLockRecoveryPollingInterval": "00:01:00"
[7/5/2019 4:20:01 AM] }
[7/5/2019 4:20:01 AM] Starting JobHost
[7/5/2019 4:20:01 AM] Starting Host (HostId=azuretest-1452989547, InstanceId=8d079fb6-fbae-42db-8523-522eafaea10f, Versi
on=2.0.12507.0, ProcessId=9368, AppDomainId=1, InDebugMode=False, InDiagnosticMode=False, FunctionsExtensionVersion=)
[7/5/2019 4:20:01 AM] Loading functions metadata
[7/5/2019 4:20:01 AM] 1 functions loaded
[7/5/2019 4:20:01 AM] Starting language worker process:python "C:\Users\azureAdmin\AppData\Roaming\npm\node_modules\azu
re-functions-core-tools\bin\workerspython\worker.py" --host 127.0.0.1 --port 54321 --workerId 8a3ab589-b4f6-4f08-9b96-2
8172137ae10 --requestId f0dfd5ae-f8f1-4545-bb63-68ad5626e92b --grpcMaxMessageLength 134217728
[7/5/2019 4:20:01 AM] python process with Id=9652 started
[7/5/2019 4:20:01 AM] Generating 1 job function(s)
[7/5/2019 4:20:01 AM] Found the following functions:
[7/5/2019 4:20:01 AM] Host.Functions.HttpTrigger
[7/5/2019 4:20:01 AM]
[7/5/2019 4:20:01 AM] Host initialized (33ms)
[7/5/2019 4:20:01 AM] Host started (39ms)
[7/5/2019 4:20:01 AM] Job host started
[7/5/2019 4:20:01 AM] Host restarted.
[7/5/2019 4:20:01 AM] Stopping JobHost
[7/5/2019 4:20:01 AM] Job host stopped
[7/5/2019 4:20:01 AM] INFO: Starting Azure Functions Python Worker.
[7/5/2019 4:20:01 AM] INFO: Worker ID: 8a3ab589-b4f6-4f08-9b96-28172137ae10, Request ID: f0dfd5ae-f8f1-4545-bb63-68ad56
26e92b, Host Address: 127.0.0.1:54321
[7/5/2019 4:20:01 AM] INFO: Successfully opened gRPC channel to 127.0.0.1:54321
[7/5/2019 4:20:01 AM] INFO: Received WorkerInitRequest, request ID f0dfd5ae-f8f1-4545-bb63-68ad5626e92b
[7/5/2019 4:20:01 AM] INFO: Received FunctionLoadRequest, request ID: f0dfd5ae-f8f1-4545-bb63-68ad5626e92b, function ID
: 6cc24466-ec80-474f-b792-ccd8170513bb
[7/5/2019 4:20:01 AM] INFO: Successfully processed FunctionLoadRequest, request ID: f0dfd5ae-f8f1-4545-bb63-68ad5626e92
b, function ID: 6cc24466-ec80-474f-b792-ccd8170513bb
[7/5/2019 4:20:06 AM] Host lock lease acquired by instance ID '000000000000000000000000DC83C698'.
[7/5/2019 4:22:30 AM] Executing HTTP request: {
[7/5/2019 4:22:30 AM] "requestId": "8a60497c-7626-4923-a999-a15078af2a88",
[7/5/2019 4:22:30 AM] "method": "GET",
[7/5/2019 4:22:30 AM] "uri": "/api/HttpTrigger"
[7/5/2019 4:22:30 AM] }
[7/5/2019 4:22:30 AM] Executing 'Functions.HttpTrigger' (Reason='This function was programmatically called via the host
APIs.', Id=c4aef534-9b6f-4020-9895-0ef5258359b1)
[7/5/2019 4:22:30 AM] INFO: Received FunctionInvocationRequest, request ID: f0dfd5ae-f8f1-4545-bb63-68ad5626e92b, funct
ion ID: 6cc24466-ec80-474f-b792-ccd8170513bb, invocation ID: c4aef534-9b6f-4020-9895-0ef5258359b1
[7/5/2019 4:22:30 AM] INFO: Successfully processed FunctionInvocationRequest, request ID: f0dfd5ae-f8f1-4545-bb63-68ad5
626e92b, function ID: 6cc24466-ec80-474f-b792-ccd8170513bb, invocation ID: c4aef534-9b6f-4020-9895-0ef5258359b1
[7/5/2019 4:22:30 AM] Python HTTP trigger function processed a request.
[7/5/2019 4:22:30 AM] Executed 'Functions.HttpTrigger' (Succeeded, Id=c4aef534-9b6f-4020-9895-0ef5258359b1)
[7/5/2019 4:22:30 AM] Executed HTTP request: {
[7/5/2019 4:22:30 AM] "requestId": "8a60497c-7626-4923-a999-a15078af2a88",
[7/5/2019 4:22:30 AM] "method": "GET",
[7/5/2019 4:22:30 AM] "uri": "/api/HttpTrigger",
[7/5/2019 4:22:30 AM] "identities": [
[7/5/2019 4:22:30 AM] {
[7/5/2019 4:22:30 AM] "type": "WebJobsAuthLevel",
[7/5/2019 4:22:30 AM] "level": "Admin"
[7/5/2019 4:22:30 AM] }
[7/5/2019 4:22:30 AM] ],
[7/5/2019 4:22:30 AM] "status": 200,
[7/5/2019 4:22:30 AM] "duration": 795
[7/5/2019 4:22:30 AM] }
[7/5/2019 4:22:37 AM] Executing HTTP request: {
[7/5/2019 4:22:37 AM] "requestId": "a5cb20e5-a7f0-4d11-8cf2-33cc8b717518",
[7/5/2019 4:22:37 AM] "method": "GET",
[7/5/2019 4:22:37 AM] "uri": "/api/HttpTrigger"
[7/5/2019 4:22:37 AM] }
[7/5/2019 4:22:37 AM] Executing 'Functions.HttpTrigger' (Reason='This function was programmatically called via the host
APIs.', Id=fe80563a-8c4d-4ea9-9ff7-55f2d2a6502f)
[7/5/2019 4:22:37 AM] INFO: Received FunctionInvocationRequest, request ID: f0dfd5ae-f8f1-4545-bb63-68ad5626e92b, funct
ion ID: 6cc24466-ec80-474f-b792-ccd8170513bb, invocation ID: fe80563a-8c4d-4ea9-9ff7-55f2d2a6502f
[7/5/2019 4:22:37 AM] INFO: Successfully processed FunctionInvocationRequest, request ID: f0dfd5ae-f8f1-4545-bb63-68ad5
626e92b, function ID: 6cc24466-ec80-474f-b792-ccd8170513bb, invocation ID: fe80563a-8c4d-4ea9-9ff7-55f2d2a6502f
[7/5/2019 4:22:37 AM] Python HTTP trigger function processed a request.
[7/5/2019 4:22:37 AM] Executed 'Functions.HttpTrigger' (Succeeded, Id=fe80563a-8c4d-4ea9-9ff7-55f2d2a6502f)
[7/5/2019 4:22:37 AM] Executed HTTP request: {
[7/5/2019 4:22:37 AM] "requestId": "a5cb20e5-a7f0-4d11-8cf2-33cc8b717518",
[7/5/2019 4:22:37 AM] "method": "GET",
[7/5/2019 4:22:37 AM] "uri": "/api/HttpTrigger",
[7/5/2019 4:22:37 AM] "identities": [
[7/5/2019 4:22:37 AM] {
[7/5/2019 4:22:37 AM] "type": "WebJobsAuthLevel",
[7/5/2019 4:22:37 AM] "level": "Admin"
[7/5/2019 4:22:37 AM] }
[7/5/2019 4:22:37 AM] ],
[7/5/2019 4:22:37 AM] "status": 200,
[7/5/2019 4:22:37 AM] "duration": 19
[7/5/2019 4:22:37 AM] }
[7/5/2019 4:22:49 AM] Executing HTTP request: {
[7/5/2019 4:22:49 AM] "requestId": "f4cae481-4950-40e7-ae51-4ec97dc770b6",
[7/5/2019 4:22:49 AM] "method": "GET",
[7/5/2019 4:22:49 AM] "uri": "/api/HttpTrigger"
[7/5/2019 4:22:49 AM] }
[7/5/2019 4:22:49 AM] Executing 'Functions.HttpTrigger' (Reason='This function was programmatically called via the host
APIs.', Id=39a7cf03-0414-4907-974e-293b56ab4f2c)
[7/5/2019 4:22:49 AM] INFO: Received FunctionInvocationRequest, request ID: f0dfd5ae-f8f1-4545-bb63-68ad5626e92b, funct
ion ID: 6cc24466-ec80-474f-b792-ccd8170513bb, invocation ID: 39a7cf03-0414-4907-974e-293b56ab4f2c
[7/5/2019 4:22:49 AM] INFO: Successfully processed FunctionInvocationRequest, request ID: f0dfd5ae-f8f1-4545-bb63-68ad5
626e92b, function ID: 6cc24466-ec80-474f-b792-ccd8170513bb, invocation ID: 39a7cf03-0414-4907-974e-293b56ab4f2c
[7/5/2019 4:22:49 AM] Python HTTP trigger function processed a request.
[7/5/2019 4:22:49 AM] Executed 'Functions.HttpTrigger' (Succeeded, Id=39a7cf03-0414-4907-974e-293b56ab4f2c)
[7/5/2019 4:22:49 AM] Executed HTTP request: {
[7/5/2019 4:22:49 AM] "requestId": "f4cae481-4950-40e7-ae51-4ec97dc770b6",
[7/5/2019 4:22:49 AM] "method": "GET",
[7/5/2019 4:22:49 AM] "uri": "/api/HttpTrigger",
[7/5/2019 4:22:49 AM] "identities": [
[7/5/2019 4:22:49 AM] {
[7/5/2019 4:22:49 AM] "type": "WebJobsAuthLevel",
[7/5/2019 4:22:49 AM] "level": "Admin"
[7/5/2019 4:22:49 AM] }
[7/5/2019 4:22:49 AM] ],
[7/5/2019 4:22:49 AM] "status": 200,
[7/5/2019 4:22:49 AM] "duration": 24
[7/5/2019 4:22:49 AM] }

Thanks, @jcanose81! - At line: (.venv) PS C:\Users\azureAdmin> the (.venv) part indicates that you've activated Python virtual environment and it looks like your Python Functions is up and running OK now!

Since this channel is for driving improvements towards MS Docs and we haven't identified any actionable item in your feedback, we will now proceed to close this thread. If there are further questions regarding specific detail of this documentation, please reopen it and we will gladly continue the discussion. For any general help and questions, please open a thread on MSDN forums.

Python is activating, but when I use git bash to enter "func azure functionapp publish " that's when I get the error that there is no valid python version.

It's when I try to publish the app that I get the python error from my initial post.

Edit - July 8th 2019
I found other documentation on creating an HTTPTrigger
The below worked perfectly.
https://docs.microsoft.com/en-us/azure/azure-functions/functions-create-first-azure-function

I appreciate all the help and comments with this issue. Perhaps when I have more time I will re-visit the Python error and figure it out.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

paulmarshall picture paulmarshall  Â·  3Comments

behnam89 picture behnam89  Â·  3Comments

monteledwards picture monteledwards  Â·  3Comments

jebeld17 picture jebeld17  Â·  3Comments

jharbieh picture jharbieh  Â·  3Comments