question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support running on M1 Macs [Python]

See original GitHub issue

Hey,

i am running into issues with python azure function under VSCode. FYI the same example I will present is working fine with JS.

Set up: Mac M1 Big Sur v11.2.1 python 3.9.1 Core Tools Version: 3.0.3284

I am following the usual workflow: func init, func new, func start. When I start the function, this is what I get:

Found Python version 3.9.1 (python3).

Azure Functions Core Tools
Core Tools Version:       3.0.3284 Commit hash: 98bc25e668274edd175a1647fe5a9bc4ffb6887d 
Function Runtime Version: 3.0.15371.0

Ä2021-02-16T20:28:10.779ZÅ Traceback (most recent call last):
Ä2021-02-16T20:28:10.783ZÅ   File "/opt/homebrew/Cellar/azure-functions-core-toolsÉ3/3.0.3284/workers/python/3.9/OSX/X64/worker.py", line 84, in <module>
Ä2021-02-16T20:28:10.783ZÅ     from azure_functions_worker import main
Ä2021-02-16T20:28:10.783ZÅ   File "/opt/homebrew/Cellar/azure-functions-core-toolsÉ3/3.0.3284/workers/python/3.9/OSX/X64/azure_functions_worker/main.py", line 8, in <module>
Ä2021-02-16T20:28:10.783ZÅ     from . import dispatcher
Ä2021-02-16T20:28:10.783ZÅ   File "/opt/homebrew/Cellar/azure-functions-core-toolsÉ3/3.0.3284/workers/python/3.9/OSX/X64/azure_functions_worker/dispatcher.py", line 21, in <module>
Ä2021-02-16T20:28:10.783ZÅ     import grpc
Ä2021-02-16T20:28:10.783ZÅ   File "/opt/homebrew/Cellar/azure-functions-core-toolsÉ3/3.0.3284/workers/python/3.9/OSX/X64/grpc/__init__.py", line 23, in <module>
Ä2021-02-16T20:28:10.783ZÅ     from grpc._cython import cygrpc as _cygrpc
Ä2021-02-16T20:28:10.784ZÅ ImportError: dlopen(/opt/homebrew/Cellar/azure-functions-core-toolsÉ3/3.0.3284/workers/python/3.9/OSX/X64/grpc/_cython/cygrpc.cpython-39-darwin.so, 2): no suitable image found.  Did find:
Ä2021-02-16T20:28:10.785ZÅ  /opt/homebrew/Cellar/azure-functions-core-toolsÉ3/3.0.3284/workers/python/3.9/OSX/X64/grpc/_cython/cygrpc.cpython-39-darwin.so: mach-o, but wrong architecture
Ä2021-02-16T20:28:10.788ZÅ  /opt/homebrew/Cellar/azure-functions-core-toolsÉ3/3.0.3284/workers/python/3.9/OSX/X64/grpc/_cython/cygrpc.cpython-39-darwin.so: mach-o, but wrong architecture
Ä2021-02-16T20:28:10.788ZÅ Traceback (most recent call last):
Ä2021-02-16T20:28:10.788ZÅ   File "/opt/homebrew/Cellar/azure-functions-core-toolsÉ3/3.0.3284/workers/python/3.9/OSX/X64/worker.py", line 84, in <module>
Ä2021-02-16T20:28:10.788ZÅ     from azure_functions_worker import main
Ä2021-02-16T20:28:10.794ZÅ   File "/opt/homebrew/Cellar/azure-functions-core-toolsÉ3/3.0.3284/workers/python/3.9/OSX/X64/azure_functions_worker/main.py", line 8, in <module>
Ä2021-02-16T20:28:10.794ZÅ     from . import dispatcher
Ä2021-02-16T20:28:10.794ZÅ   File "/opt/homebrew/Cellar/azure-functions-core-toolsÉ3/3.0.3284/workers/python/3.9/OSX/X64/azure_functions_worker/dispatcher.py", line 21, in <module>
Ä2021-02-16T20:28:10.794ZÅ     import grpc
Ä2021-02-16T20:28:10.794ZÅ   File "/opt/homebrew/Cellar/azure-functions-core-toolsÉ3/3.0.3284/workers/python/3.9/OSX/X64/grpc/__init__.py", line 23, in <module>
Ä2021-02-16T20:28:10.799ZÅ     from grpc._cython import cygrpc as _cygrpc
Ä2021-02-16T20:28:10.799ZÅ **ImportError: dlopen(/opt/homebrew/Cellar/azure-functions-core-toolsÉ3/3.0.3284/workers/python/3.9/OSX/X64/grpc/_cython/cygrpc.cpython-39-darwin.so, 2): no suitable image found.  Did find:**
Ä2021-02-16T20:28:10.799ZÅ  /opt/homebrew/Cellar/azure-functions-core-toolsÉ3/3.0.3284/workers/python/3.9/OSX/X64/grpc/_cython/cygrpc.cpython-39-darwin.so: mach-o, but wrong architecture
Ä2021-02-16T20:28:10.799ZÅ  /opt/homebrew/Cellar/azure-functions-core-toolsÉ3/3.0.3284/workers/python/3.9/OSX/X64/grpc/_cython/cygrpc.cpython-39-darwin.so: mach-o, but wrong architecture
Ä2021-02-16T20:28:10.799ZÅ Traceback (most recent call last):
Ä2021-02-16T20:28:10.800ZÅ   File "/opt/homebrew/Cellar/azure-functions-core-toolsÉ3/3.0.3284/workers/python/3.9/OSX/X64/worker.py", line 84, in <module>
Ä2021-02-16T20:28:10.800ZÅ     from azure_functions_worker import main
Ä2021-02-16T20:28:10.800ZÅ   File "/opt/homebrew/Cellar/azure-functions-core-toolsÉ3/3.0.3284/workers/python/3.9/OSX/X64/azure_functions_worker/main.py", line 8, in <module>
Ä2021-02-16T20:28:10.800ZÅ     from . import dispatcher
Ä2021-02-16T20:28:10.800ZÅ   File "/opt/homebrew/Cellar/azure-functions-core-toolsÉ3/3.0.3284/workers/python/3.9/OSX/X64/azure_functions_worker/dispatcher.py", line 21, in <module>
Ä2021-02-16T20:28:10.800ZÅ     import grpc
Ä2021-02-16T20:28:10.800ZÅ   File "/opt/homebrew/Cellar/azure-functions-core-toolsÉ3/3.0.3284/workers/python/3.9/OSX/X64/grpc/__init__.py", line 23, in <module>
Ä2021-02-16T20:28:10.800ZÅ     from grpc._cython import cygrpc as _cygrpc
Ä2021-02-16T20:28:10.800ZÅ **ImportError: dlopen(/opt/homebrew/Cellar/azure-functions-core-toolsÉ3/3.0.3284/workers/python/3.9/OSX/X64/grpc/_cython/cygrpc.cpython-39-darwin.so, 2): no suitable image found.  Did find:**
Ä2021-02-16T20:28:10.800ZÅ  /opt/homebrew/Cellar/azure-functions-core-toolsÉ3/3.0.3284/workers/python/3.9/OSX/X64/grpc/_cython/cygrpc.cpython-39-darwin.so: mach-o, but wrong architecture
Ä2021-02-16T20:28:10.801ZÅ Exceeded language worker restart retry count for runtime:python. Shutting down and proactively recycling the Functions Host to recover
Ä2021-02-16T20:28:10.808ZÅ  /opt/homebrew/Cellar/azure-functions-core-toolsÉ3/3.0.3284/workers/python/3.9/OSX/X64/grpc/_cython/cygrpc.cpython-39-darwin.so: mach-o, but wrong architecture

Functions:

 HttpTrigger: ÄGET,POSTÅ http://localhost:7071/api/HttpTrigger

For detailed output, run func with --verbose flag.

I would appreciate some advice here! Thanks and all the best

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:19
  • Comments:74 (9 by maintainers)

github_iconTop GitHub Comments

33reactions
shreyabatra4commented, Nov 29, 2022

Hi all, to provide an update here, support for Python 3.10 in Azure Functions will officially be released on 12/14. This will not include M1 support. The team is prioritizing this feature and I will update on this thread once I have additional insight to a timeline. Thanks so much for your patience on this.

30reactions
rdruzhkovcommented, Nov 8, 2022

Hi @shreyabatra4! Could you estimate time you need to introduce the support for M1?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why Python native on M1 Max is gre… - Apple Developer
First put my questions here: Why python run natively on M1 Max is greatly (~100%) slower than on my old MacBook Pro 2016...
Read more >
How to Easily Set Up Python on Any M1 Mac | by Frank Andrade
In this guide, I will show you how to easily set up Python on any M1 Mac using anaconda and miniforge.
Read more >
A Python Data Scientist's Guide to the Apple Silicon…
Although sometimes called an 8 core CPU, the M1 is best described as a 4+4 core CPU. There are 4 “high-performance cores” (sometimes...
Read more >
How can I run Python 3.9.1 natively on M1 Mac?
The question is about running natively, not through Rosetta translation. Running python 3.9.1 on the ARM M1 chip, Python processes are labeled ' ......
Read more >
Why Your Python Version (or other apps) Don't Work on the ...
You can now run Python on the Apple MacBook with M1 Chip ... Python 3.9.1 becomes the first version of the language to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found