1. jupyterlab 설치
pip3 install jupyter
pip3 install jupyterlab
2. ipykernel 설치
pip3 install ipykernel
3. 가상환경 생성 및 실행
가상환경은 아나콘다를 사용합니다.
conda create -n [name] python=3.8
conda activate [name]
/* 샘플 가상환경 생성 */
conda create -n vpython3.8 python=3.8
4. 가상환경 확인
conda info -e or conda info -env
5. 커널추가
python -m ipykernel install --user --name=[name]
/* 가상환경을 커널에 추가 해 줘야 브라우저(주피터노트북)에서 해당 버전을 사용할수 있음 */
python -m ipykernel install --user --name=vpython3.8
python -m ipykernel install --user --name=base
6. 커널확인
jupyter kernelspec list
0.00s - Debugger warning: It seems that frozen modules are being used, which may
0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off
0.00s - to python to disable frozen modules.
0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation.
Available kernels:
base /home/cbw/.local/share/jupyter/kernels/base
vpython3.8 /home/cbw/.local/share/jupyter/kernels/vpython3.8
python3 /home/cbw/anaconda3/share/jupyter/kernels/python3
7. 커널삭제
jupyter kernelspec uninstall [name]
(base) cbw@gpusystem:~/anaconda3/bin$ jupyter kernelspec uninstall vpython3.8
Kernel specs to remove:
vpython3.8 /home/cbw/.local/share/jupyter/kernels/vpython3.8
Remove 1 kernel specs [y/N]: y
Removed /home/cbw/.local/share/jupyter/kernels/vpython3.8
(base) cbw@gpusystem:~/anaconda3/bin$ jupyter kernelspec list
0.00s - Debugger warning: It seems that frozen modules are being used, which may
0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off
0.00s - to python to disable frozen modules.
0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation.
Available kernels:
base /home/cbw/.local/share/jupyter/kernels/base
python3 /home/cbw/anaconda3/share/jupyter/kernels/python3
(base) cbw@gpusystem:~/anaconda3/bin$
8. 외부접속 설정
jupyter-lab --generate-config
/* 접속비밀번호 생성 */
jupyter-lab password
Enter password
Verify password
/* 패스워드 해시파일 생성 */
(base) cbw@gpusystem:~/anaconda3/bin$ jupyter-lab --generate-config
Writing default config to: /home/cbw/.jupyter/jupyter_lab_config.py
vi /home/cbw/.jupyter/jupyter_lab_config.py
c.ServerApp.password = '생성된비밀번호'
c.ServerApp.ip = '0.0.0.0'
c.ServerApp.allow_origin = '*'
c.ServerApp.notebook_dir = '/home/cbw/workspace'
c.ServerApp.port = 8890
c.ServerApp.password_required = True
c.ServerApp.open_browser = False
9. 쥬피터 노트북 기동
/* 기동 */
jupyter lab
10. 위치찾기
whereis jupyter-lab
/home/cbw/anaconda3/bin/jupyter-lab
11. 백그라운 실행 스크립트 생성
vi jupyter-lab-start.sh
nohup /home/cbw/anaconda3/bin/jupyter-lab 1>/dev/null 2>&1 &
/* 실행권한 부여 */
chmod 777 jupyter-lab-start.sh
/* 주피터 랩 실행 */
./jupyter-lab-start.sh
/* 실행 확인 */
cbw@gpusystem:~/workspace$ ps -ef|grep jupyter-lab
cbw 3323461 1 16 15:40 pts/11 00:00:02 /home/cbw/anaconda3/bin/python /home/cbw/anaconda3/bin/jupyter-lab
'IT > AI' 카테고리의 다른 글
LangChain 구성도 (LLM) prompts, Chains, Agents,Memory (0) | 2024.05.25 |
---|---|
Ubunto 22.04[우분투 22.04] code-server 설치하기 (0) | 2024.05.20 |
ollama 우분투 22.04에 설치 하기 (0) | 2024.05.20 |
우분투 22.04 원격접속 XRDP 설정 (0) | 2024.05.20 |
우분투 22.04 NVIDIA GPU 사용현황 체크 & CUDA torch 사용가능 확인 (0) | 2024.05.20 |
댓글