[dagit] Dagit does not run on M1 (Apple Silicon)
See original GitHub issueSummary
I was going through the Getting Started docs for Dagster and was following along on a newer Macbook using an M1 chip. When I tried to start Dagit, I ran into an error, and I’m not able to figure out a quick workaround.
I think the issue might be with an upstream dependency, but I wanted to report it here first, in case I was mistaken.
Reproduction
- Install Dagster with
pip install dagster
. - Create
hello_world.py
as described in the getting started docs. - Install Dagit with
pip install dagit
. - Run
dagit -f hello_world.py
Expected behavior
The Dagit command does not output an error, and localhost:3000
hosts an instance of the Dagit UI.
Actual behavior
The Dagit command fails with this error:
Traceback (most recent call last):
File "/Users/praneetsahgal/.pyenv/versions/3.10.0/bin/dagit", line 5, in <module>
from dagit.cli import main
File "/Users/praneetsahgal/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dagit/__init__.py", line 1, in <module>
from dagster.core.utils import check_dagster_package_version
File "/Users/praneetsahgal/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dagster/__init__.py", line 175, in <module>
from dagster.core.launcher import DefaultRunLauncher
File "/Users/praneetsahgal/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dagster/core/launcher/__init__.py", line 1, in <module>
from .base import (
File "/Users/praneetsahgal/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dagster/core/launcher/base.py", line 8, in <module>
from dagster.core.workspace.workspace import IWorkspace
File "/Users/praneetsahgal/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dagster/core/workspace/__init__.py", line 1, in <module>
from .context import IWorkspaceProcessContext, WorkspaceProcessContext
File "/Users/praneetsahgal/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dagster/core/workspace/context.py", line 13, in <module>
from dagster.core.host_representation import (
File "/Users/praneetsahgal/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dagster/core/host_representation/__init__.py", line 9, in <module>
from .external import (
File "/Users/praneetsahgal/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dagster/core/host_representation/external.py", line 24, in <module>
from .handle import JobHandle, PartitionSetHandle, PipelineHandle, RepositoryHandle
File "/Users/praneetsahgal/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dagster/core/host_representation/handle.py", line 4, in <module>
from dagster.core.host_representation.origin import ExternalRepositoryOrigin
File "/Users/praneetsahgal/.pyenv/versions/3.10.0/lib/python3.10/site-packages/dagster/core/host_representation/origin.py", line 8, in <module>
import grpc
File "/Users/praneetsahgal/.pyenv/versions/3.10.0/lib/python3.10/site-packages/grpc/__init__.py", line 22, in <module>
from grpc import _compression
File "/Users/praneetsahgal/.pyenv/versions/3.10.0/lib/python3.10/site-packages/grpc/_compression.py", line 15, in <module>
from grpc._cython import cygrpc
ImportError: dlopen(/Users/praneetsahgal/.pyenv/versions/3.10.0/lib/python3.10/site-packages/grpc/_cython/cygrpc.cpython-310-darwin.so, 0x0002): tried: '/Users/praneetsahgal/.pyenv/versions/3.10.0/lib/python3.10/site-packages/grpc/_cython/cygrpc.cpython-310-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')), '/usr/local/lib/cygrpc.cpython-310-darwin.so' (no such file), '/usr/lib/cygrpc.cpython-310-darwin.so' (no such file)
Additional Info about Your Environment
- Device: 2021 16-inch Macbook Pro (running an M1 chip)
- Python version: 3.10.0
- Pip version: 21.3.1
- I was prompted to install Rosetta earlier, so I think I have it installed.
Message from the maintainers:
Impacted by this bug? Give it a 👍. We factor engagement into prioritization.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:16
- Comments:18 (4 by maintainers)
Top Results From Across the Web
Install Dagster on M1 MacBook - Ask Different
Try this - it worked on my M1 Max MacBook Pro: python3 -m venv dagster. source dagster/bin/activate. pip3 install dagster dagit.
Read more >Why Python native on M1 Max is gre… - Apple Developer
On M1 Max, why run in PyCharm IDE is constantly slower ~20% than run from terminal, which doesn't happen on my old Intel...
Read more >If you need to install Rosetta on your Mac - Apple Support
You're asked to install Rosetta the first time you open an app that needs Rosetta. Click Install, then enter your user name and...
Read more >Mac computers with Apple silicon
A Mac with an Intel processor is also known as an Intel-based Mac. Published Date: July 25, 2022. Helpful? Yes No. Character limit:...
Read more >Is it possible to get Mojave on M1 mac - Apple Community
One can not downgrade to a version of macOS lower than the version ... and below could not be understood on the M1...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Using python 3.9.x and installing grpc with conda, solved the problem to me
https://github.com/grpc/grpc/issues/25082#issuecomment-878271247
conda install grpcio
OK, I finally solved the issue for me. I spend hours on it and as I installed it forth and back it’s hard to say what in the end solved the problem. But still, I want to give some pointers to folks who have similar issues. My problem was deeper that
asdf
was probably having a wonky python installation or that this installation wasn’t properly set up witharch=arm64
/I believe at the end solved it by completely removing
asdf
as explained here. And reinstall with these additional settings:Now I could properly install any python version without errors such as
I could then successfully install the problematic
grpcio
and also run dagster/dagit without below error that I got the strange error in the meantime.The error I got after I managed to install grpcio when starting dagit or dagster: