Cài lại VPS – Cài Jupyter Notebook

Table of Contents
Sau khi upgrade thì Ubuntu tự cài sẵn python3 rồi

Cài Pip3 cho Python 3

sudo apt-get -y install python3-pip

-y auto yes =))

Update pip3

pip3 install --upgrade pip

Kiểm tra version pip3

pip3 --version

Xóa cài lại pip3

sudo python3 -m pip uninstall pip && sudo apt install python3-pip --reinstall

Bị lỗi gọi pip không được thì gọi cách này

python3 -m pip --version

Cài môi trường ảo 

python3 -m pip install virtualenv

Báo lỗi pip cũ không cài dược thì nâng cấp

python3 -m pip install --upgrade pip

Check version pip mới

python3 -m pip --version

Xóa môi trường ảo cài lại

python3 -m pip uninstall virtualenv
python3 -m pip install virtualenv

Tạo môi trường ảo cho Jupyter Notebook

virtualenv jupyter

Active môi trường ảo

source jupyter/bin/activate

Từ giờ cài thêm Packge gì là nó chỉ nằm trong folder Jupyter (môi trường ảo) thôi

Trong môi trường này thì python và pip mặc định sẽ là Python3

Cài Jupyter Notebook

pip install jupyter

Khởi động Jupyter Notebook

jupyter notebook --allow-root --no-browser

Cấu hình Jupyter Notebook ra ngoài

Tạo file config

jupyter notebook --generate-config

/root/.jupyter/jupyter_notebook_config.py

Cấu hình cho phép truy cập từ bên ngoài vào Jupyter notebook

c.NotebookApp.ip = ‘0.0.0.0’

Liệt kê các Jupyter notebook đang chạy, port và thông tin khác

jupyter notebook list

Khởi động Jupyter notebook với tùy chỉnh port

jupyter notebook --port 9999 --allow-root

Tắt Jupyter notebook

Trong cửa sổ terminal nhấn Ctrl + C

Setup Password

jupyter notebook password

/root/.jupyter/jupyter_notebook_config.json

Chèn hash pass vào jupyter_notebook_config.py

c.NotebookApp.password = u'sha1:67c9e60bb8b6:9ffede0825894254b2e042ea597d771089e11aed'

/root/.jupyter/jupyter_notebook_config.py

Mở port trên Ubuntu

sudo ufw allow 9999

sudo ufw status verbose

Cơ mà, What!@@, không mở port được. hum hum

-tắt, save lại thôi

-soiqualang_chentreu-

]]>

Leave a Reply

Your email address will not be published. Required fields are marked *