카테고리 없음

Ubuntu Anaconda에서 jupyter notebook 설치

SciomageLAB 2024. 10. 18. 00:13
반응형

Ubuntu Anaconda에서 jupyter notebook 설치하는 방법. 구글링하면 다 나오는 방법인데, 간단하게 스크립트만 따로 정리해 봤다.

# Install notebook
$ pip install notebook

# Config
$ jupyter notebook --generate-config
Writing default config to: /home/dkdk/.jupyter/jupyter_notebook_config.py

# Config PW
$ python
Python 3.8.0 (default, Nov  6 2019, 21:49:08) 
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type help, copyright, credits or license for more information.
>>> from notebook.auth import passwd
>>> passwd()
Enter password: 
Verify password: 
'argon2:$argon2id$v=19$m=10240,t=10,p=8$xxxxxxxxxxxxxxxxxxxxxxxxx'
>>> exit()

Config file 수정

$ vim /home/dkdk/.jupyter/jupyter_notebook_config.py

c.NotebookApp.allow_origin = '*'
c.NotebookApp.ip = '0.0.0.0'
c.NotebookApp.notebook_dir = '/home/user'
c.NotebookApp.password = 'argon2:$argon2id$v=19$m=10240,t=10,p=8$xxxxxxxxxxxxxxxxxxxxxxxxx'

실행

$ jupyter notebook

Conda venv 추가

# kernel 연결 확인
jupyter kernelspec list

# conda kernel package 설치
conda install nb_conda_kernels

python -m ipykernel install --user --name <MY_KERNEL_NAME> --display-name <DISPLAY_NAME>

# kernel 연결 확인
jupyter kernelspec list
반응형