I am trying to run python automation project on Mac M1 Pro OS 14.2.1 and I am getting the following error:
ImportError: dlopen(/Users/{username}/PycharmProjects/EzeAuto/venv/lib/python3.8/site-packages/_cffi_backend.cpython-38-darwin.so, 0x0002):
'/Users/{usernname}/PycharmProjects/EzeAuto/venv/lib/python3.8/site-packages/_cffi_backend.cpython-38-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))
thread '<unnamed>' panicked at 'Python API call failed', note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Traceback (most recent call last):
.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
export JAVA_HOME=$(/usr/libexec/java_home)
export PATH=$JAVA_HOME/bin:$PATH
export PYENV_ROOT="/opt/homebrew"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
Please find more details on the Interpreter settings that I have configured in my pycharm project
[Interpreter settings in pycharm](https://i.stack.imgur.com/EPJ56.png)
~ % pyenv version
3.8.12 (set by /opt/homebrew/version)
~ % which python3
/usr/bin/python3
~ % python3 --version
Python 3.9.6
~ % pyenv
pyenv 2.3.36
~ % which pyenv
pyenv () {
local command
command="${1:-}"
if [ "$#" -gt 0 ]
then
shift
fi
case "$command" in
(activate | deactivate | rehash | shell) eval "$(pyenv "sh-$command" "$@")" ;;
(*) command pyenv "$command" "$@" ;;
esac
}
Tried uninstalling and installing the pyenv again but could not make it work.
Really need of help on this.