rohan kantaria
rohan kantaria

Reputation: 43

Azure Function - Failed to start a new language worker for runtime: Python (M1 Mac incompatible architecture (have 'x86_64', need 'arm64e'))

I am trying to Build http triggered python function app. I just initialized it using terminal commands. I have not modified anything in base template. I am trying to run it on localhost but when I use 'func start host' I get this ImportError:

ImportError: dlopen(/opt/homebrew/Cellar/azure-functions-core-tools@4/4.0.3971/workers/python/3.7/OSX/X64/grpc/_cython/cygrpc.cpython-37m-darwin.so, 0x0002): tried: '/opt/homebrew/Cellar/azure-functions-core-tools@4/4.0.3971/workers/python/3.7/OSX/X64/grpc/_cython/cygrpc.cpython-37m-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')), '/usr/local/lib/cygrpc.cpython-37m-darwin.so' (no such file), '/usr/lib/cygrpc.cpython-37m-darwin.so' (no such file)

even after this error it seems function is hosted on localhost and I get localhost link to trigger api call, but when I try to call via api the host api it doesn't respond and just crashes with following errors.

error log

Upvotes: 3

Views: 4185

Answers (3)

Aman Tandon
Aman Tandon

Reputation: 1509

Issue is working fine for me when I am starting the func start in python env having the version as 3.10.12.

Also there is another verion 3.9.13 as mentioned in the issue, if that helps. https://github.com/Azure/azure-functions-core-tools/issues/2834

Upvotes: 0

Yugesh
Yugesh

Reputation: 108

This is an existing issue. The workaround could be using the python interpreter from a conda environment

  1. Create a conda environment with supported python version

  2. Go to the root directory of the project

  3. Remove .venv folder

  4. Activate the newly created conda environment

  5. Create new virtual environment using python -m venv .venv/

OR

you could manually select python interpreter while creating the azure function Image

Upvotes: 0

Daniel Mann
Daniel Mann

Reputation: 59055

The function runtime does not support M1 processors at this time.

https://github.com/Azure/azure-functions-core-tools/issues/2834

Upvotes: 1

Related Questions