[MacOS] Apple Silicon Mac(M1, M2, M3...)에 Python2 설치하기
https://github.com/luin/medis 를 설치하려는데
GitHub - luin/medis: 💻 Medis is a beautiful, easy-to-use Mac database management application for Redis.
💻 Medis is a beautiful, easy-to-use Mac database management application for Redis. - GitHub - luin/medis: 💻 Medis is a beautiful, easy-to-use Mac database management application for Redis.
github.com
node-gyp
error가 발생해서 살펴보니 Pythn2가 필요하다는 내용이 있어 M1 Mac북에 Python2를 설치하려니 일반적인 방법으로는 설치가 되지 않는 다는 것을 알았다
M1 Mac에 Python2를 설치하기 위해서는 pyenv
라는 패키지를 설치하고 pyenv
패키지로 Python2를 설치해야 한다
Applie Silicon Mac에 Python2 설치하기
pyenv
패키지 설치
brew install pyenv
Python2 설치
pyenv install 2.7.18
Python2 버전 확인
cd ~/.pyenv/versions/2.7.18
./python --version
Python 2.7.18
설치한 Python2 링크 걸기
Python2 링크를 걸고 싶다면 참고
https://freedeveloper.tistory.com/281
[MacOS] 맥 Python 기본 버전 변경하기
파이썬 설치 brew install python 설치된 파이썬 정보보기 ls -l /usr/local/bin/python* 또는 ls -l /opt/homebrew/bin/python* lrwxr-xr-x 1 freelife admin 24 10 11 17:55 /usr/local/bin/python -> /usr/local/bin/python3.8 lrwxr-xr-x 1 freelife adm
freedeveloper.tistory.com
Python2 링크 걸기
sudo ln -s -f ~/.pyenv/versions/2.7.18/bin/python /opt/homebrew/bin/python2
Python2 링크로 버전 확인
python2 --version
node-gyp 에러 해결을 위한 Setting
node-gyp
에러 해결을 위헤 npm config를 Python2로 셋팅
npm config set python /opt/homebrew/bin/python2
node-gyp
패키지 설치
npm i -g node-gyp