๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

Python/Jupyter

Ubuntu ์—์„œ Jupyter lab ์„ค์น˜, ์›๊ฒฉ ์„ค์ •

๋ฐ˜์‘ํ˜•

python ์„ค์น˜ ํ•„์š”ํ•œ ๊ฒฝ์šฐ

sudo apt install python3
sudo apt install python3-pip

 

์„ค์น˜

pip3 install jupyterlab

 

Config ํŒŒ์ผ ์ƒ์„ฑ

jupyter lab --generate-config

 

jupyter์— ์ ‘์†ํ•  ๋น„๋ฐ€๋ฒˆํ˜ธ ์„ค์ •

jupyter notebook password

 

์›๊ฒฉ ์„ค์ •

jupyter_lab_config.py ์ˆ˜์ •

๊ฒฝ๋กœ : /home/ubuntu/.jupyter/jupyter_lab_config.py

c.ServerApp.allow_remote_access = True
c.ServerApp.ip = '0.0.0.0' # or '*' : ๋ชจ๋“  ip ์ ‘์† ๊ฐ€๋Šฅ

# ์™ธ๋ถ€์—์„œ jupyter ์ธํ„ฐํŽ˜์ด์Šค์— ์ฒ˜์Œ ์ ‘์†ํ–ˆ์„ ๋•Œ ๋‚˜์˜ค๋Š” ๊ฒฝ๋กœ๋ฅผ ์„ค์ •
c.NotebookApp.notebook_dir

 

 

Jupyter๋ฅผ ํ•ญ์ƒ ์‹คํ–‰ ๊ฐ€๋Šฅํ•˜๋„๋ก ํ•˜๊ธฐ

sudo vim /etc/systemd/system/jupyterlab.service

์ž…๋ ฅ

[Unit]
Description=Jupyter Lab Server
 
[Service]
ExecStart=/usr/local/bin/jupyter-lab --allow-root --config="/home/ubuntu/.jupyter/jupyter_lab_config.py"
WorkingDirectory=/home/ubuntu/jupyter
 
[Install]
WantedBy=multi-user.target

 

 

 

sudo systemctl daemon-reload
sudo systemctl enable jupyterlab
sudo systemctl start jupyterlab

 

sudo systemctl status jupyterNotebook

 

์˜ค๋ฅ˜ ๋ฐœ์ƒ

  • jupyter-lab: command not found on Ubuntu
export PATH="$HOME/.local/bin:$PATH"
pip install jupyterlab
# and it will work again,

https://ashley-tharp.medium.com/solved-jupyter-lab-command-not-found-on-ubuntu-820d5e97510d

 

[Solved] jupyter-lab: command not found on Ubuntu

How to fix this?

ashley-tharp.medium.com

 

 

 

apt ์—์„œ markupsafe ์‚ญ์ œ

sudo -H pip3 install jinja2

 

ํ•˜๊ณ  ํ•ด๊ฒฐ..

 

 

https://khann.tistory.com/5

 

๋ฆฌ๋ˆ…์Šค์—์„œ Service ๋“ฑ๋กํ•˜๊ธฐ

๋ฆฌ๋ˆ…์Šค์—์„œ ์ž๋™์‹คํ–‰์„ ์œ„ํ•ด Service๋ฅผ ๋“ฑ๋กํ•ด๋ณด๊ฒ ๋‹ค. WHY? ๋จผ์ € ๋ฆฌ๋ˆ…์Šค ์„œ๋ฒ„๋‚˜ ํด๋ผ์ด์–ธํŠธ์˜ ๋จธ์‹ ์—์„œ ๋ถ€ํŒ…์‹œ ์ž๋™์œผ๋กœ ์‹คํ–‰๋˜๊ฒŒ ํ•˜๊ณ ์‹ถ์€ application์ด ์žˆ๊ฑฐ๋‚˜, server application์˜ stop, restart๋“ฑ์„ ์‰ฝ

khann.tistory.com

 

 

ํฌํŠธํฌ์›Œ๋”ฉ

 

ํฌํŠธํฌ์›Œ๋”ฉ

- OUTPUT ์„ค์ •์œผ๋กœ ์™ธ๋ถ€ํฌํŠธ 80๋ฒˆ์—์„œ ๋‚ด๋ถ€ 8888๋ฒˆ์œผ๋กœ ๋“ค์–ด์˜ค๊ฒŒ ์„ค์ •ํ•ด๋ณธ๋‹ค.

sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8888

 

ํฌํŠธ ํ™•์ธ

sudo iptables -t nat -L

 

iptable ์ƒํƒœ ํ™•์ธ

์•„๋ž˜์˜ ๋ช…๋ น์–ด๋กœ ๋ชจ๋“  ์ฒด์ธ์˜ ๊ทœ์น™์ด๋‚˜ ํŠน์ • ์ฒด์ธ์˜ ๊ทœ์น™์„ ์•Œ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

iptables --list
iptables -L

 

 

https://m.blog.naver.com/PostView.naver?isHttpsRedirect=true&blogId=on21life&logNo=221182596171 

 

UNIX/Linux - ๋ฆฌ๋ˆ…์Šค iptables ๋ช…๋ น์–ด ํฌํŠธํฌ์›Œ๋”ฉ ์—ด๊ธฐ/๋‹ซ๊ธฐ *์ˆ˜์ •์‚ญ์ œ์˜ˆ์ •

๋‚ด๋ถ€ํฌํŠธ 8080์œผ๋กœ ์—ด์–ด๋‘” ์„œ๋น„์Šค๋ฅผ ๋‚ด๋ถ€ํฌํŠธ 80์œผ๋กœ ๋ฐ”์ธ๋”ฉ iptables Port forwarding ๋ฆฌ๋ˆ…์Šค(Linux)์—...

blog.naver.com

 

https://blog.storyg.co/%EC%9A%B4%EC%98%81/iptables/iptables-%EB%B0%A9%ED%99%94%EB%B2%BD-%EA%B4%80%EB%A6%AC

 

iptables ๋ฐฉํ™”๋ฒฝ ํฌํŠธ ๊ด€๋ฆฌ(์—ด๊ธฐ/๋‹ซ๊ธฐ) · Story's G Blog

iptables ๋ฐฉํ™”๋ฒฝ ํฌํŠธ ๊ด€๋ฆฌ(์—ด๊ธฐ/๋‹ซ๊ธฐ) 31 Dec 2019 <!-- iwinv ์—์„œ ์ธ์Šคํ„ด์Šค๋ฅผ ์ƒ์„ฑํ•˜๋ฉด ๊ด€๋ฆฌ ์ฝ˜์†”์—์„œ ๋ฐฉํ™”๋ณ€ ์„ค์ •์„ํ•˜์ง€ ์•Š์•˜์–ด๋„ ๊ธฐ๋ณธ์ ์œผ๋กœ `iptables` ๋กœ ๋ฐฉํ™”๋ฒฝ์ด ๋˜์–ด์žˆ์Šต๋‹ˆ๋‹ค. ๊ทธ๋ž˜์„œ `iptables` ์—

blog.storyg.co

 

 

 

 

https://glanceyes.tistory.com/entry/%EC%9B%90%EA%B2%A9-%EC%84%9C%EB%B2%84%EC%97%90%EC%84%9C-Jupyter-Notebook-%EB%98%90%EB%8A%94-Jupyter-Lab%EC%9D%84-%EC%8B%A4%ED%96%89%ED%95%98%EC%97%AC-%EC%A0%91%EC%86%8D%ED%95%98%EA%B8%B0

 

์›๊ฒฉ ์„œ๋ฒ„์—์„œ Jupyter Notebook ๋˜๋Š” Jupyter Lab์„ ์‹คํ–‰ํ•˜์—ฌ ์ ‘์†ํ•˜๊ธฐ

์›๊ฒฉ ์„œ๋ฒ„์—์„œ Jupyter Notebook ๋˜๋Š” Jupyter Lab ์‹คํ–‰ ๋ฐ ์ ‘์†ํ•˜๊ธฐ ์ž์‹ ์—๊ฒŒ ํ• ๋‹น๋ฐ›๊ฑฐ๋‚˜ ๋˜๋Š” ์ž์‹ ์ด ์šด์˜ ์ค‘์ธ ์„œ๋ฒ„๊ฐ€ ์žˆ๋Š”๋ฐ, ์ด๋ฅผ ์›๊ฒฉ์œผ๋กœ ์ ‘์†ํ•˜์—ฌ jupyter ํ™˜๊ฒฝ์„ ์ด์šฉํ•˜๊ณ  ์‹ถ์„ ๋•Œ ์œ ์šฉํ•  ์ˆ˜ ์žˆ์Šต

glanceyes.tistory.com

 

 

 

 

https://jmholly.tistory.com/entry/Ubuntu-2004-%EB%82%B4%EB%B6%80-IP%EB%A5%BC-%EC%99%B8%EB%B6%80%EC%97%90%EC%84%9C-%EC%A0%91%EC%86%8D%EC%9D%B4-%EA%B0%80%EB%8A%A5%ED%95%98%EB%8F%84%EB%A1%9D-%ED%8F%AC%ED%8A%B8%ED%8F%AC%EC%9B%8C%EB%94%A9port-forwading-%ED%95%98%EA%B8%B0

 

[Ubuntu 20.04] ๋‚ด๋ถ€ IP๋ฅผ ์™ธ๋ถ€์—์„œ ์ ‘์†์ด ๊ฐ€๋Šฅํ•˜๋„๋ก ํฌํŠธํฌ์›Œ๋”ฉ(port forwading) ํ•˜๊ธฐ

1. ํฌํŠธํฌ์›Œ๋“œ์ „ ๋ฐฑ์—… mkdir iptables_backup cd iptables_backup iptables-save > 2021.08.26.rule #๋ณต์›ํ•  ๋•Œ iptables-restore < 2021.08.26.rule 2. 80๋ฒˆ ํฌํŠธ์—์„œ 300076ํฌํŠธ๋กœ ํฌํŠธํฌ์›Œ๋”ฉ iptables -A PRERO..

jmholly.tistory.com

 

https://yorublog.tistory.com/65

 

๋ผ์ฆˆ๋ฒ ๋ฆฌํŒŒ์ด์— ํŒŒ์ด์ฌ ๋””์Šค์ฝ”๋“œ ๋ด‡ ํ˜ธ์ŠคํŒ…ํ•˜๊ธฐ

์ด ๊ธ€์—์„œ๋Š” ๋ผ์ฆˆ๋ฒ ๋ฆฌํŒŒ์ด์— ๋””์Šค์ฝ”๋“œ ๋ด‡์„ ํ˜ธ์ŠคํŒ…ํ•˜์ง€๋งŒ, ์šฐ๋ถ„ํˆฌ์—์„œ๋„ ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค. ๋ผ์ฆˆ๋ฒ ๋ฆฌํŒŒ์ด๊ฐ€ ์—†๊ฑฐ๋‚˜ ์„ค์น˜๋˜์–ด ์žˆ๋Š” ์„œ๋ฒ„์ปดํ“จํ„ฐ(๋˜๋Š” VPS)๊ฐ€ ์—†๋Š” ๊ฒฝ์šฐ ์—ฌ๊ธฐ๋ฅผ ๋ˆŒ๋Ÿฌ VPS์ด์ •๋ฆฌ ๊ธ€์„์ฐธ๊ณ 

yorublog.tistory.com

 

๋ฐ˜์‘ํ˜•

'Python > Jupyter' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๋‹ค๋ฅธ ๊ธ€

ubuntu / jupyter lab / flutter  (2) 2024.10.11
[Python] jupyter ์—์„œ event loop ์˜ค๋ฅ˜ ๋‚  ๋•Œ  (0) 2022.09.08
[Juyter] Tips  (0) 2022.07.19
[jupyter] Terminal ์—†์• ๊ธฐ  (0) 2020.06.01