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

가상환경 설치

conda create -n python python
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-macos tensorflow-metal # TensowFlow
pip install torch torchvision # Pytorch
pip install jupyter jupyterlab
jupyter kernelspec install-self --user
jupyter kernelspec list # Python kernel 변경 확인
vi ~/Library/Jupyter/kernels/python3/kernel.json # Python 3.XX 로 디스플레이 이름 변경

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/Caskroom/miniforge/base/envs/sage/share/jupyter/kernels/sagemath # Error 메시지 나오지만 무시
jupyter kernelspec list # SageMath kernel 변경 확인
 

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

conda run -n julia --no-capture-output jupyter lab​
 

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

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

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

2. 다음을 실행한다.

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

+ Recent posts