我的系統是CentOS 7
第一步 https://repo.continuum.io/archive/ 找到適合自己版本的64位安裝包 如Anaconda3-2020.02-Linux-x86_64.sh
第二步 安裝 命令
wget https://repo.continuum.io/archive/Anaconda3-2020.02-Linux-x86_64.sh
bash Anaconda3-2020.02-Linux-x86_64.sh
conda 查看安裝狀態
第三步 進入ipython 輸入ipython
進入後
from notebook.auth import passwd passwd() #輸入方便你記的密碼,連續輸;兩次..輸完密碼後,會輸出一個字符串,形如: ’sha1:9e7************************888’ #將其保存下來, 完成以上操作後,通過exit()推出ipython環境
第四步 配置jupyter notebook
進入到安裝目錄:cd /root/anaconda3/etc/jupyter, 執行 :
jupyter notebook --generate-config
#(命令會產生配置文件:root/.jupyter/jupyter_notebook_config.py)
vi jupyter_notebook_config.py
c.NotebookApp.ip = '*' #允許訪問此服務器的 IP,星號表示任意 IP c.NotebookApp.password = u'sha1:*******************************8c' # 之前生成的密碼 hash 字串 c.NotebookApp.open_browser = False # 運行時不打開本機瀏覽器 c.NotebookApp.port = 2799 # 使用的端口,隨意設置 c.NotebookApp.enable_mathjax = True # 啓用 MathJax c.NotebookApp.allow_root = True c.NotebookApp.notebook_dir = u'/root/JupyterNotebook' #工作目錄,保存代碼項目文件。
退出文件並保存 :wq
這樣就安裝完畢了,重啓VPS
然後 jupyter notebook 啓動
如果要後臺一直跑,不隨你的xshell 關閉而停止運行,
nohup jupyter notebook &
進入到你的VPS IP 如111:111:111:11:2799,成功了