-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support running on M1 Macs [Python] #915
Comments
@FabianBruengerPexon we are waiting to get the machine to be able to test this. |
I'm also seeing this on M1 Mac Mini running: |
Also experiencing this issue. Please see Azure/azure-functions-core-tools#2680 Returning M1 Macbook, sadly, as this issue has clearly been rumbling on for many months! |
Still experiencing this on M1 MacBook Pro, Python 3.9.7, Core Tools 3.0.3785. |
The issue is still present.
|
Still got the exact same error. Running two macbooks for this right now, waiting to solve this problem. Lets hope it comes quick in some way. |
Looks like Core Tools is able to run in x64 emulation but it’s starting the python worker in ARM. The worker uses x64 binaries in some places and that’s where it appears to be failing. Are you able to run the entire stack with x64 emulation? I only have an Intel Mac so I can’t try this out. /cc @vrdmr |
For Node.js we were able to fix this by using a pure JS implementation of gRPC that doesn’t rely on platform specific binaries. |
Unable to test this at present but (thinking out loud here): I'm wondering if running everything in a conda environment of some description would help in the interim? Using conda environments has solved a ton of (unrelated) problems for me over the past few months while x86 and arm64 code is living side by side. |
This was a good hint, thank you! I was able to start What have I done?
refer to https://stackoverflow.com/questions/64882584/how-to-run-the-homebrew-installer-under-rosetta-2-on-m1-macbook
|
Cleaning up M1 Mac issues at the moment. This one seemed like the most detailed Python issue, so I've transferred it here to track any Python-specific work. Main core tools issue is here: Azure/azure-functions-core-tools#2834 Also this comment from @vrdmr seems particularly relevant: Azure/azure-functions-core-tools#2394 (comment) |
Also experiencing this issue. M1 Macbook Pro
|
Fyi @vrdmr I've created an arm64 build of core tools and I now see this error when running on an M1 Mac:
I believe that's because Arm64 is not listed in the worker config here. Let me know when you have an arm64 build of the worker and I'd be happy to test for you. |
Running into the same issue as @ericdwkim. Also noted that this works with python 3.8 environments, but not with python 3.9. Is there an ETA for the fix @ejizba? |
|
For the wary traveller, I have tried a bunch of these without success and wasn't willing to switch to x86, this trick, while maybe bad practice, worked for me (basically copying over the binary): |
Any updates on this? Silver lining is it's forced me to write more testing harnesses 😬 , but it's getting a little tricky to troubleshoot in some scenarios.. |
Hi, this issue should be resolved with the release of support for Python 3.10 in Functions, which is planned for end of May. |
Hi @shreyabatra4 Do you maybe have any info on estimated release date for Function App Python3.10 support? |
^I have the same question |
@danielw1534 In the meantime you can try this workaround |
Is this fixed? non of the workaround works for me |
I do not want to sound hater, but seriously I have not known functionality that has had so many delays, it is incredible that since 2021 is promising that this functionality will come out and nothing. It already seems to me a lack of respect to all users that they have decided not to respond so as not to continue to look bad. please report what is happening with this new release? |
Hi everyone - thank you again for all your patience with this release! I empathize with your comments on the multiple delays of this release, and we really appreciate your understanding and feedback. I do have some good news - support for ARM 64 is now released! Please upgrade to the newest Core Tools (4.0.5455) to try it out. I will close this issue out alongside our official announcement for this feature! Please comment and let us know if you have any feedback when trying it out. |
Thank you for the update, Shreya. I look forward to the official documentation to try this on the MacBook. |
available in brew, thanks @shreyabatra4! |
Worked like a charm, all I need to do is to upgrade to the latest version of azure-functions-core-tool. thanks @shreyabatra4! |
Thank you for releasing this @shreyabatra4! Are these supposed to be there, or am I asking something impossible here? Install script used in docker building script which works on a amd64 computer, but not on a arm64 macbook:
|
Works like a charm for me. Thanks so much! |
The new solution worked (mostly) great for me. Has anyone gotten the warning "Customer packages not in sys path. This should never happen!" when running the func start command? I get this from any Azure Function project, both ones that I have created a new environment for since the update and those from prior to the update. I do not, however, get this on any other Python project on my computer, suggesting this could be related to the Core Tools. |
@lucasfijen - For your issue - are you installing core tools inside docker running on your Mac?
@r-findley - This is an issue that we caused due to incorrect logging, and the fix (#1335 from @hallvictoria) will be part of the next release of the Functions (host + core tools). Please ignore this log for the time being - it is a red herring. |
Closing this issue - Apologies for the delay, and we will work towards ensuring faster releases and getting them out sooner. Thanks a lot for continuing to use Python Functions and we'd love to hear your feedback on M1 and other features. |
When I try to start the function I get the following error in my terminal: [2023-11-15T08:24:49.287Z] ImportError: cannot import name 'cygrpc' from 'grpc._cython' (/opt/homebrew/Cellar/azure-functions-core-tools@4/4.0.5455/workers/python/3.10/OSX/Arm64/grpc/_cython/__init__.py)
[2023-11-15T08:24:49.291Z] Language Worker Process exited. Pid=83729.
[2023-11-15T08:24:49.291Z] python3 exited with code 1 (0x1). ImportError: cannot import name 'cygrpc' from 'grpc._cython' (/opt/homebrew/Cellar/azure-functions-core-tools@4/4.0.5455/workers/python/3.10/OSX/Arm64/grpc/_cython/__init__.py),ImportError: cannot import name 'cygrpc' from 'grpc._cython' (/opt/homebrew/Cellar/azure-functions-core-tools@4/4.0.5455/workers/python/3.10/OSX/Arm64/grpc/_cython/__init__.py),ImportError: cannot import name 'cygrpc' from 'grpc._cython' (/opt/homebrew/Cellar/azure-functions-core-tools@4/4.0.5455/workers/python/3.10/OSX/Arm64/grpc/_cython/__init__.py).
[2023-11-15T08:24:49.292Z] Exceeded language worker restart retry count for runtime:python. Shutting down and proactively recycling the Functions Host to recover The command I'm using to start the function is |
I'm trying to install it indeed at the building scripts of my devcontainer. I tried this in 2 ways, either with: or with a postcreatecommand in which I added:
Both return the same unable to locate azure-functions-core-tools. I think the issue is that brew is not available in a debian based devcontainer, but as for the links in my previous command, the arm64 based debian packages are not published where these methods will be searching. |
@lucasfijen I'm running into the same issue when trying to install it in a Docker container. Did you sort out this issue? Thanks! |
Unfortunately I haven't yet, still hoping to get some help on this:) |
Closing out this issue as support for Apple Silicon Macs is now released. Please provide feedback by filling out this survey. To fill it in, click "New discussion" and the form will show up. Thanks all for your patience with this feature once again! |
The ticket is closed but I still find an issue using Azure function core tools running on Apple M2 Max chip
Found Python version 3.10.13 (python3). Azure Functions Core Tools [2024-02-13T02:54:13.203Z] ERROR: unhandled error in functions worker: dlopen(/opt/homebrew/Cellar/azure-functions-core-tools@4/4.0.5455/workers/python/3.10/OSX/Arm64/grpc/_cython/cygrpc.cpython-310-darwin.so, 0x0002): symbol not found in flat namespace '_CFRelease' |
I can confirm I no longer need to use emulation and an "arch -x86_64" version of homebrew to run func core tools on apple silicon. Thanks for implementing this. |
It would be helpful to publish the arm64 version to Debian packages, if that's possible :) Currently, we must use emulation to run Debian-based devcontainer |
I could successfully run "func start" with .venv. But couldn't run it with conda environment. python -m venv .venv |
I still see the issue with apple 4.0.5907
|
Same for me, getting errors with version 4.0.5907 on M2 using Python 3.11.9. |
Okay nvm... Seems to be a problem after an update. I've done a |
@shreyabatra4 here we go:
|
full command:
|
Having the same issue on M2 Pro python3.10 and core tools 4.0.5907 |
As a workaround you can install grpcio using pip in your venv and the copy the whole directory .venv/lib/python3./site-packages/grpc/ to /opt/homebrew/Cellar/azure-functions-core-tools@4/<x.x.xxxx>/workers/python/3./OSX/Arm64/grpc if you installed azure-fuctions-core-tools using homebrew. Otherwise it might be in a different location but the concept is the same. The whole directory needs to be copied to replace the grpc version provided in azure-function-core-tools with the correct one. Not sure why it is broken in core-tools for M1 but been like that for a while. |
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:
I would appreciate some advice here!
Thanks and all the best
The text was updated successfully, but these errors were encountered: