Azure-docs: Help ! - AttributeError: module 'azure.functions_worker' has no attribute 'start_async' error on >func host start

Created on 7 Feb 2019  Â·  16Comments  Â·  Source: MicrosoftDocs/azure-docs

I am following the below documentation to create the first Python Http trigger function.
https://docs.microsoft.com/en-us/azure/azure-functions/functions-create-first-function-python

I get an error :- AttributeError: module 'azure.functions_worker' has no attribute 'start_async'. when trying to run func host start. I am unable to proceed further

I have the below versions installed
Python 3.6, node v10.15.1, npm -- v6.4.1

Find below the detailed error :-
[07/02/2019 17:12:18] Traceback (most recent call last):
[07/02/2019 17:12:18] Traceback (most recent call last):
[07/02/2019 17:12:18] File "C:\Users\Test\AppData\Roaming\npm\node_modules\azure-functions-core-tools\bin\workers\python\worker.py", line 37, in main
[07/02/2019 17:12:18] File "C:\Users\Test\AppData\Roaming\npm\node_modules\azure-functions-core-tools\bin\workers\python\worker.py", line 46, in
[07/02/2019 17:12:18] return aio_compat.run(azure.functions_worker.start_async(
[07/02/2019 17:12:18] main()
[07/02/2019 17:12:18] AttributeError: module 'azure.functions_worker' has no attribute 'start_async'
[07/02/2019 17:12:18] File "C:\Users\Test\AppData\Roaming\npm\node_modules\azure-functions-core-tools\bin\workers\python\worker.py", line 37, in main
[07/02/2019 17:12:18] return aio_compat.run(azure.functions_worker.start_async(
[07/02/2019 17:12:18] AttributeError: module 'azure.functions_worker' has no attribute 'start_async'
[07/02/2019 17:12:19] Language Worker Process exited.
[07/02/2019 17:12:19] python exited with code 1
AttributeError: module 'azure.functions_worker' has no attribute 'start_async'.
[07/02/2019 17:12:19] Starting language worker process:python "C:\Users\Test\AppData\Roaming\npm\node_modules\azure-functions-core-tools\bin\workers\python\worker.py" --host 127.0.0.1 --port 63752 --workerId 4a387359-109a-4fb2-a9d1-bd1e857d2f02 --requestId 5689c9d4-f79b-4d22-b35c-22c757ba0d46 --grpcMaxMessageLength 134217728
[07/02/2019 17:12:19] python process with Id=15956 started
[07/02/2019 17:12:19] Traceback (most recent call last):
[07/02/2019 17:12:19] Traceback (most recent call last):
[07/02/2019 17:12:19] File "C:\Users\Test\AppData\Roaming\npm\node_modules\azure-functions-core-tools\bin\workers\python\worker.py", line 37, in main
[07/02/2019 17:12:19] File "C:\Users\Test\AppData\Roaming\npm\node_modules\azure-functions-core-tools\bin\workers\python\worker.py", line 46, in
[07/02/2019 17:12:19] return aio_compat.run(azure.functions_worker.start_async(
[07/02/2019 17:12:19] main()
[07/02/2019 17:12:19] AttributeError: module 'azure.functions_worker' has no attribute 'start_async'
[07/02/2019 17:12:19] File "C:\Users\Test\AppData\Roaming\npm\node_modules\azure-functions-core-tools\bin\workers\python\worker.py", line 37, in main
[07/02/2019 17:12:19] return aio_compat.run(azure.functions_worker.start_async(
[07/02/2019 17:12:19] AttributeError: module 'azure.functions_worker' has no attribute 'start_async'
[07/02/2019 17:12:19] Language Worker Process exited.
[07/02/2019 17:12:19] python exited with code 1
AttributeError: module 'azure.functions_worker' has no attribute 'start_async'.
[07/02/2019 17:12:19] Starting language worker process:python "C:\Users\Test\AppData\Roaming\npm\node_modules\azure-functions-core-tools\bin\workers\python\worker.py" --host 127.0.0.1 --port 63752 --workerId 31763193-3e9d-4105-a682-f2c4b63a922f --requestId e6e4f881-b974-4a97-af5a-3ffe2d0a9160 --grpcMaxMessageLength 134217728
[07/02/2019 17:12:19] python process with Id=17880 started
[07/02/2019 17:12:19] Traceback (most recent call last):
[07/02/2019 17:12:19] Traceback (most recent call last):
[07/02/2019 17:12:19] File "C:\Users\Test\AppData\Roaming\npm\node_modules\azure-functions-core-tools\bin\workers\python\worker.py", line 37, in main
[07/02/2019 17:12:19] File "C:\Users\Test\AppData\Roaming\npm\node_modules\azure-functions-core-tools\bin\workers\python\worker.py", line 46, in
[07/02/2019 17:12:19] return aio_compat.run(azure.functions_worker.start_async(
[07/02/2019 17:12:19] main()
[07/02/2019 17:12:19] AttributeError: module 'azure.functions_worker' has no attribute 'start_async'
[07/02/2019 17:12:19] File "C:\Users\Test\AppData\Roaming\npm\node_modules\azure-functions-core-tools\bin\workers\python\worker.py", line 37, in main
[07/02/2019 17:12:19] return aio_compat.run(azure.functions_worker.start_async(
[07/02/2019 17:12:19] AttributeError: module 'azure.functions_worker' has no attribute 'start_async'
[07/02/2019 17:12:19] Language Worker Process exited.
[07/02/2019 17:12:19] python exited with code 1
AttributeError: module 'azure.functions_worker' has no attribute 'start_async'.
[07/02/2019 17:12:23] Host lock lease acquired by instance ID '000000000000000000000000D8971BE3'.


Document Details

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

Pri1 cxp doc-bug functionsvc resolved-by-customer triaged

Most helpful comment

Thanks @mike-urnun-msft

So the problem was with python 3.6.0
Upgrading python to 3.6.8 solve the issue.
https://github.com/Azure/azure-functions-core-tools/issues/1050

It will be worth to have this information in the docs.

All 16 comments

Thanks for the feedback! We are currently investigating and will update you shortly.

Do i need to install additional modules - azure.functions_worker ? . Where can i find these modules ?

Any feedback on this please ?

@Infoseeker I assume you are running in a venv.
+ @asavaritayal who wrote this article.

Yes, it works only on a linux environment. I am trying to install the tools using choclatey for windows.

Meet the same error in Win 10, net core 2,2, python 3.6 environment! Need help!

UnInstall azure cli core tools and install using choclatey
https://docs.microsoft.com/en-us/azure/azure-functions/functions-run-local#v2
It works fine !. Hope that helps.

@Infoseeker Glad to hear the issue is resolved and you're unblocked.

We will now proceed to close this thread for now. If there are further questions regarding this matter, please reopen it and we will gladly continue the discussion.

UnInstall azure cli core tools and install using choclatey
https://docs.microsoft.com/en-us/azure/azure-functions/functions-run-local#v2
It works fine !. Hope that helps.

Thanks for your reply but it doesn't help. I still get the message like followings:

System.Private.CoreLib: Exception while executing function: Functions.HttpTrigger. System.Private.CoreLib: Failed to start language worker for: python. One or more errors occurred. (python exited with code 1
AttributeError: module 'azure.functions_worker' has no attribute 'start_async') (python exited with code 1
AttributeError: module 'azure.functions_worker' has no attribute 'start_async') (python exited with code 1
AttributeError: module 'azure.functions_worker' has no attribute 'start_async'). python exited with code 1
AttributeError: module 'azure.functions_worker' has no attribute 'start_async'.

Hi,
It is still failing.

@mike-urnun-msft can you reopen this issue?

Today I tried to run azure function in python.
I am working on Windows.

Created project using:
func init pythonProject --worker-runtime python
Created python function using:
func new --language python --template "HttpTrigger" --name myFunction

All this steps succeed:
Next tried to host them using:
func host start
And when all succeed got message:

Now listening on: http://0.0.0.0:7071
Application started. Press Ctrl+C to shut down.

Http Functions:

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

[14.02.2019 19:37:26] Traceback (most recent call last):
[14.02.2019 19:37:26] Traceback (most recent call last):
[14.02.2019 19:37:26]   File "C:\Users\xxxx\AppData\Roaming\npm\node_modules\azure-functions-core-tools\bin\workers\python\worker.py", line 37, in main
[14.02.2019 19:37:26]   File "C:\Users\xxxx\AppData\Roaming\npm\node_modules\azure-functions-core-tools\bin\workers\python\worker.py", line 46, in <module>
[14.02.2019 19:37:26]     return aio_compat.run(azure.functions_worker.start_async(
[14.02.2019 19:37:26]     main()
[14.02.2019 19:37:26] AttributeError: module 'azure.functions_worker' has no attribute 'start_async'
[14.02.2019 19:37:26]   File "C:\Users\xxxx\AppData\Roaming\npm\node_modules\azure-functions-core-tools\bin\workers\python\worker.py", line 37, in main
[14.02.2019 19:37:26]     return aio_compat.run(azure.functions_worker.start_async(
[14.02.2019 19:37:26] AttributeError: module 'azure.functions_worker' has no attribute 'start_async'
[14.02.2019 19:37:26] Language Worker Process exited.
[14.02.2019 19:37:26] python exited with code 1
 AttributeError: module 'azure.functions_worker' has no attribute 'start_async'.

Any thoughts?

Installing via chocolatey doesn't solve the issue. In the end, it just uses azure-functions-core-tools
The path will be just different.
I installed latest version 2.4.317 but tried also [email protected].
The same result.
I also check that the same instructions work for dotent and node

@asavaritayal any thoughts?

Hi @wolszakp I have gone through the steps again with version specs below and didn't run into any issues:
Python v3.6.8
Node v10.15.3
Npm 6.4.1
Core Tools 2.4.419

Closing as no faulty steps were found. If there are further questions regarding this matter, please reopen it and we will gladly continue the discussion.

Thanks @mike-urnun-msft

So the problem was with python 3.6.0
Upgrading python to 3.6.8 solve the issue.
https://github.com/Azure/azure-functions-core-tools/issues/1050

It will be worth to have this information in the docs.

This issue appeared for me on a project that I've been working on for a while.

The only thing I changed was updating azure-functions-core-tools on Friday in another project.

I've been using python 3.6.5 and these packages:

asn1crypto==0.24.0
atomicwrites==1.3.0
attrs==19.1.0
azure-common==1.1.18
azure-functions==1.0.0b3
azure-functions-worker==1.0.0b4
azure-storage-blob==1.5.0
azure-storage-common==1.4.0
certifi==2019.3.9
cffi==1.12.2
chardet==3.0.4
colorama==0.4.1
coverage==4.5.3
cryptography==2.6.1
grpcio==1.14.2
grpcio-tools==1.14.2
idna==2.8
more-itertools==6.0.0
pluggy==0.9.0
protobuf==3.7.0
py==1.8.0
pycparser==2.19
pydevd==1.6.0
pytest==4.3.1
python-dateutil==2.8.0
pytz==2018.9
requests==2.21.0
six==1.12.0
urllib3==1.24.1
XlsxWriter==1.1.2

and
[email protected] [email protected]

This is also an issue for me with the following version:
Python v3.6.8
Node v11.13.0
Npm 6.9.0
Core Tools 2.7.1158

[5/22/2019 2:15:10 PM] Traceback (most recent call last):
[5/22/2019 2:15:10 PM] File "C:\Program Files (x86)\Nodist\binnode_modulesazure-functions-core-tools\bin\workers\python\worker.py", line 37, in main
[5/22/2019 2:15:10 PM] return aio_compat.run(azure.functions_worker.start_async(
[5/22/2019 2:15:10 PM] AttributeError: module 'azure.functions_worker' has no attribute 'start_async'
[5/22/2019 2:15:10 PM] Traceback (most recent call last):
[5/22/2019 2:15:10 PM] File "C:\Program Files (x86)\Nodist\binnode_modulesazure-functions-core-tools\bin\workers\python\worker.py", line 46, in
[5/22/2019 2:15:10 PM] main()
[5/22/2019 2:15:10 PM] File "C:\Program Files (x86)\Nodist\binnode_modulesazure-functions-core-tools\bin\workers\python\worker.py", line 37, in main
[5/22/2019 2:15:10 PM] return aio_compat.run(azure.functions_worker.start_async(
[5/22/2019 2:15:10 PM] AttributeError: module 'azure.functions_worker' has no attribute 'start_async'
[5/22/2019 2:15:10 PM] Language Worker Process exited.
[5/22/2019 2:15:10 PM] python exited with code 1
AttributeError: module 'azure.functions_worker' has no attribute 'start_async'.

Hi @wolszakp I have gone through the steps again with version specs below and didn't run into any issues:
Python v3.6.8
Node v10.15.3
Npm 6.4.1
Core Tools 2.4.419

Closing as no faulty steps were found. If there are further questions regarding this matter, please reopen it and we will gladly continue the discussion.

It is worth mentioning core tools version in docs @mike-urnun-msft

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Ponant picture Ponant  Â·  3Comments

spottedmahn picture spottedmahn  Â·  3Comments

bdcoder2 picture bdcoder2  Â·  3Comments

jharbieh picture jharbieh  Â·  3Comments

Agazoth picture Agazoth  Â·  3Comments