Xcode command line tools 설치

xcode-select --install

Homebrew 를 설치

https://brew.sh/

 

Homebrew

The Missing Package Manager for macOS (or Linux).

brew.sh

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew upgrade

Homebrew 로 miniforge 를 설치

brew install miniforge
conda config --add channels conda-forge
conda update conda
conda init zsh
source ~/.zshrc
conda env list
conda config --set auto_activate_base false

Jupyter 설치

brew install python
pip3 install jupyter jupyterlab

가상환경을 통해 프로그램 설치

- Julia의 경우에는 https://julialang.org/downloads/ 에서 설치파일 이용하여 base에 설치
- SageMath의 경우에는 https://github.com/3-manifolds/Sage_macOS/releases/ 에서 설치파일을 이용하여 base에 설치

conda create -n python python=3.10
# conda create -n julia julia
# conda create -n sage sage
conda env list

Jupyter에 Python kernel 추가하기

conda activate python
pip install numpy scipy sympy scikit-learn matplotlib pandas pandas-datareader h5py
conda install -c apple tensorflow-deps             # if osx_arm64
# pip install tensorflow tensorflow-metal          # TensowFlow if x86
pip install tensorflow-macos tensorflow-metal      # TensowFlow if osx_arm64
pip install torch torchvision                      # Pytorch
pip install jupyter jupyterlab
jupyter kernelspec list
# jupyter kernelspec remove -n python3             # Python3 커널 지우기
python -V                                          # Python 버전 확인
python -m ipykernel install --user --name python3 --display-name "Python 3.XX.X"
jupyter kernelspec list                            # Python kernel 변경 확인

Jupyter에 Julia kernel 추가하기

# conda activate julia
# pip3 install jupyterlab
julia
julia> using Pkg
julia> Pkg.add("IJulia")
julia> Pkg.update()
julia> using IJulia
julia> installkernel("Julia")
julia> exit()

Jupyter에 Sagemath kernel 추가하기

# conda activate sage
# jupyter kernelspec list            # SageMath kernel 위치 확인
# jupyter kernelspec install --user /usr/local/share/jupyter/kernels/SageMath-9.7
jupyter kernelspec list              # SageMath kernel 변경 확인

Jupyter 실행하기 (python 환경 설정에서)

conda run -n python --no-capture-output jupyter lab
 

응용프로그램 폴더에 실행 링크 만들기

1. /Applications/jupyter.sh 에 다음 내용을 추가한다.

#!/usr/bin/env zsh
cd $HOME/Documents/Jupyter
# conda run -n python --no-capture-output jupyter lab
jupyter notebook
exit 0

2. 다음을 실행한다.

mkdir $HOME/Documents/Jupyter
chmod 755 /Applications/jupyter.sh

+ Recent posts