Machine learning, Data science 를 위한 python 배포판인 아나콘다를 MacOS 환경에 설치하고 기본적인 사용법을 기록
MacOS Big Sur 11.5.1
% python
WARNING: Python 2.7 is not recommended.
This version is included in macOS for compatibility with legacy software.
Future versions of macOS will not include Python 2.7.
Instead, it is recommended that you transition to using 'python3' from within Terminal.
Python 2.7.16 (default, Jun)
[GCC Apple LLVM 12.0.5 (clang-1205.0.19.59.6) [+internal-os, ptrauth-isa=deploy on darwin
% python3
Python 3.8.2 (default, Jun)
[Clang 12.0.5 (clang-1205.0.22.11)] on darwin
python 2.7 과 3.8.2 의 두개의 버전이 설치되어 있음
anaconda 홈페이지에서 공식 버전을 다운로드하여 설치
(base) % anaconda -V
anaconda Command line client (version 1.7.2)
% conda -V
conda 4.10.1
여기서 pip 와 conda 가 혼동 될 수 있는데 pip 는 python 의 정식 지원을 받는 패키지만을 관리하는 관리자이고 conda 는 anaconda 에서 지원 받는 패키지만을 관리하는 관리자이다.
설치를 완료하게 되면 이후 MacOS 상에서 iTerm 과 같은 터미널 실행시 base 환경이 활성화 되어있는데 해제하고 싶다면 아래와 같이 진행
conda activate base
(base) conda config --set auto_activate_base false
% conda env list
# conda environments:
#
base * /opt/anaconda3
% conda activate base
% conda deactivate
% conda create -n [ENV_NAME] python=[PYTHON_VERSION]
(ENV_NAME)% conda install python=3.7
% conda update conda
% conda update anaconda
% conda update -n base conda
conda update anaconda-navigator
% conda remove —name [ENV_NAME] —all