arch -arm64 brew install python@3.10
arch -x86_64 brew install python@3.10
그런데 2022년 2월 현재 arm64로 설치하면 pip wheel들이 x86_64 용으로 빌드된 것들이 설치되어서 작업하는데 방해가 너무 심함. x86_64를 현재는 써보려고 한다. (arm64 시도해보고 하는 소리 ㅂㄷㅂㄷ)
# pip install --no-binary :all: --ignore-installed pysha3
이런 삽질을 계속 하기 싫으면 항복하고 x86_64로 설치 ㄱㄱ
$ arch -x86_64 brew install python@3.10
Error: Cannot install under Rosetta 2 in ARM default prefix (/opt/homebrew)!
To rerun under ARM use:
arch -arm64 brew install ...
To install under x86_64, install Homebrew into /usr/local.
이런 에러 메시지가 반겨줌.
이 글에 의하면 brew를 두군데 설치해야 두 architecture에 대해 다 쓸 수 있다고 한다.
% arch -x86_64 zsh
% cd /usr/local && mkdir homebrew
% chown USER:admin homebrew
% curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C homebrew
curl이 안 될텐데, homebrew는 사용자 소유로 chown할 것.
$ arch -x86_64 /usr/local/homebrew/bin/brew install python@3.10
이렇게 설치한다.
Python has been installed as
/usr/local/homebrew/opt/python@3.10/bin/python3
Unversioned symlinks `python`, `python-config`, `pip` etc. pointing to
`python3`, `python3-config`, `pip3` etc., respectively, have been installed into
/usr/local/homebrew/opt/python@3.10/libexec/bin
You can install Python packages with
/usr/local/homebrew/opt/python@3.10/bin/pip3 install <package>
They will install into the site-package directory
/usr/local/homebrew/lib/python3.10/site-packages
tkinter is no longer included with this formula, but it is available separately:
brew install python-tk@3.10
See: https://docs.brew.sh/Homebrew-and-Python
python@3.10 is keg-only, which means it was not symlinked into /usr/local/homebrew,
because this is an alternate version of another formula.
If you need to have python@3.10 first in your PATH, run:
echo 'export PATH="/usr/local/homebrew/opt/python@3.10/bin:$PATH"' >> ~/.zshrc
For compilers to find python@3.10 you may need to set:
export LDFLAGS="-L/usr/local/homebrew/opt/python@3.10/lib"
For pkg-config to find python@3.10 you may need to set:
export PKG_CONFIG_PATH="/usr/local/homebrew/opt/python@3.10/lib/pkgconfig"
이런 메시지가 나오니 잘 메모해두고,
/usr/local/homebrew/opt/python@3.10/bin/python3 -m venv VENV_PATH
로 venv 만들어서 잘 쓰면 된다.