맥에는 기본 설치되어 있어서 설치가 필요하지 않습니다만, 버전이 낮습니다.
$ python –version
brew 로 새로 설치
brew install python3
➜ ~ /opt/homebrew/bin/python3 Python 3.10.9 (main, Dec 15 2022, 17:11:09) [Clang 14.0.0 (clang-1400.0.29.202)] on darwin Type “help”, “copyright”, “credits” or “license” for more information.
exit() ➜ ~ /usr/bin/python3 Python 3.9.6 (default, Oct 18 2022, 12:41:40) [Clang 14.0.0 (clang-1400.0.29.202)] on darwin Type “help”, “copyright”, “credits” or “license” for more information. exit() ➜ ~
brew 관리되는 설치위치
/opt/homebrew/bin/python3
원래 있던 /usr/bin/python3 삭제방법???
절대 삭제하지 말것!!!
콘솔에서 python 치면 /opt/homebrew/bin/python3 가 실행되더라.
brew 로 설치한 최신 버전이 실행되도록 설정하기
.zshrc 에 alias python=python3
$ source .zshrc
패키지 설치 방법
Python package 설치는 pip3 이용
pip3 install 패키지이름