https://dagster.io/ logo
Title
i

Ivo Stoyanov

01/28/2022, 5:51 PM
Hello, I am learning dagster on Mac M1 - pip install dagster fails with clang errors due to grpcio native compilation. python 3.8 in venv, xccode tools installed Any tips?
👋 1
m

max

01/28/2022, 5:54 PM
what version of python are you running? cc @alex
a

alex

01/28/2022, 5:58 PM
are you trying to operate in an arm native environment or rosetta x86 back compat? https://github.com/dagster-io/dagster/issues/6036
i

Ivo Stoyanov

01/28/2022, 6:03 PM
I think I have rosetta. I found some tips for grpcio on M1 - trying them now
grpcio is not in requirements.txt - indirect. It is a long stack trace from clang compilation.
btw - I can't get to dagit. pip install dagster fails. I tried on x86 and it installed fine
a

alex

01/28/2022, 6:27 PM
The work around from the grpcio folks:
export GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=1
export GRPC_PYTHON_BUILD_SYSTEM_ZLIB=1
pip install dagit
Worked for me - I have separate
homebrew
installs for arm and x86 and have ensured the compilation flags are set to point at brew installed openssl in both cases
i

Ivo Stoyanov

01/28/2022, 6:30 PM
I am trying above flags, I reinstalled openssl and zlib. how to do separate install for x86 on mac m1? rosetta was installed as part of some other prior install. still same clang error
a

alex

01/28/2022, 6:58 PM
something like this to have separate terminal instances: https://apple.stackexchange.com/questions/428768/on-apple-m1-with-rosetta-how-to-open-entire-terminal-iterm-in-x86-64-architec I forget exactly the steps to set it up - but i have this in my bash_profile:
arch_name="$(uname -m)"

if [ "${arch_name}" = "x86_64" ]; then
    echo "Running in x86 mode"
    eval $(/usr/local/bin/brew shellenv)
elif [ "${arch_name}" = "arm64" ]; then
    echo "Running in Arm mode"
    eval $(/opt/homebrew/bin/brew shellenv)
else
    echo "Unexpected uname -m result ${arch_name}"
fi

# brew libraries
export LDFLAGS="-L $(brew --prefix openssl)/lib"
export CFLAGS="-I $(brew --prefix openssl)/include"
i

Ivo Stoyanov

01/28/2022, 7:04 PM
ty, I found some good instructions - starting fresh there is also mention of py 3.9
I was able to install with py 3.9 and x86 brew. Here are my notes - maybe the problem should be documented in dagster quick start?
Dagster install

X86/rosetta brew Install
See
<https://www.wisdomgeek.com/development/installing-intel-based-packages-using-homebrew-on-the-m1-mac/>

In x86 terminal

brew install zlib
brew install openssl 

python3.9 -m venv vent
source venv/bin/activate

export GRPC_PYTHON_BUILD_SYSTEM_ZLIB=1
export GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=1
# For compilers to find openssl@3 you may need to set:
export LDFLAGS="-L/usr/local/opt/openssl@3/lib"
export CPPFLAGS="-I/usr/local/opt/openssl@3/include"
export CFLAGS="-I/usr/local/opt/openssl@3/include"

# For pkg-config to find openssl@3 you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/openssl@3/lib/pkgconfig"

python -m pip cache purge
pip install wheel
pip install dagster
pip install dagit
but getting runtime errors like
but getting errors when running - I see cython and many (have 'x86_64', need 'arm64e')), '/usr/local/lib/cygrpc.cpython-39-darwin.so' (no such file)
reinstalling py3.8 in x86
--version works now - in x86 and py3.8