azure-functions-core-tools: `func host start` failing for python -> azure.functions_worker' has no attribute 'start_async'
Hi,
Today I tried to run azure function in python. I am working on Windows.
- Python 3.6 32-Bit version
- azure-functions-core-tools@2.4.317
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. It was suggested somewhere.
In the end, it just uses azure-functions-core-tools
just path will be different.
I installed latest version 2.4.317 but tried also azure-functions-core-tools@2.2.70.
The same result.
I also check that the same instructions work for dotent
and node
and they worked.
The bug appears only in python
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 17 (5 by maintainers)
FYI, I discovered that my issue was having a 32-bit version of Python installed rather than the 64-bit. Once 32-bit uninstalled and 64-bit installed, I no longer received any errors.
@wolszakp, do you happen to have an older version of
azure-functions-worker
installed globally (outside the venv)? You can check withpip freeze
outside of venv. If so, would you mind updating and trying it again?I think the error is because our worker is somehow accessing an older version of
azure-functions-worker
. This shouldn’t ideally happen. If this solves it, I will investigate why ourPython
process is accessing modules globally.@wolszakp, @JK87iab thanks for that! That (
from google.protobuf.pyext import _message
) error seems to be the real problem.Looks like this is a reported bug in Python 3.6.0 with protobuf 3.6.1.
From the issues, it seemed like several libraries had similar issues with that version of Python. If you guys wouldn’t mind updating Python to (>=) 3.6.1, that should solve the problem. Let me know if that works out.
fyi, @maiqbal11 and @elprans (in case you guys see similar issues opened in the worker repository).
@ankitkumarr -thanks. There is the error at the end:
ImportError: DLL load failed: The specified procedure could not be found.
This is the full output:
and
azure.functions_worker.__version__