linux服務器安裝anaconda:
1.1 下載安裝腳本:
wget https://repo.anaconda.com/archive/Anaconda3-5.2.0-Linux-x86_64.sh
1.2 運行安裝嚮導:
bash Anaconda3-5.2.0-Linux-x86_64.sh
1.3 確認是否安裝成功:
conda --version
linux服務器配置juypter,然後遠程使用jupyter:
1. 進入環境ipython, 在ipython環境下輸入:
from notebook.auth import passwd
passwd()
# 輸入方便你記的密碼,連續輸;兩次..輸完密碼後,會輸出一個字符串,形如: ’sha1:9e7a5c5e0a29:8cbdvsv2344d141c92beab1c5bc6e9avsdvdsvsv’
# 將其保存下來, 完成以上操作後,通過exit()推出ipython環境
2. 進入到安裝目錄:cd /home/lhc/anaconda3/etc/jupyter, 執行 :
jupyter notebook --generate-config
#(命令會產生文件:home/lhc/.jupyter/jupyter_notebook_config.py)
3. 編輯配置文件,編輯此文件,寫入
c.NotebookApp.ip = '*' # 允許訪問此服務器的 IP,星號表示任意 IP
c.NotebookApp.password = u'sha1:xxx:xxx' # 之前生成的密碼 hash 字串
c.NotebookApp.open_browser = False # 運行時不打開本機瀏覽器
c.NotebookApp.port = 12035 # 使用的端口,隨意設置
c.NotebookApp.enable_mathjax = True # 啓用 MathJax
4. 啓動服務
Jupyter notebook
sudo start jupyter # 啓動 jupyter
sudo stop/restart jupyter # 停止/重啓 jupyter
sudo status jupyter # 查看 jupyter 的狀態
windows客戶端設置
如果你是linux本地機,那麼就可以通過ssh訪問遠程服務器,在命令行中啓動jupyter notebook,
輸入localhost:8000(這裏的端口號與你設置的有關),但如果在windows下:
-
通過ssh或者xshell等工具訪問遠程服務器,在你的會話中進行設置,比如xshell中,選擇屬性-ssh-隧道,點擊添加
-
偵聽端口填寫剛纔的8000,目標端口默認是8888;
-
設置完成後,在ssh或者xshell的命令行中輸入
jupyter notebook
-
此刻,在windows本地中輸入localhost:8000就可以訪問遠程服務器上的jupyter了;
會出現設置密碼的界面,如果不記得密碼,可直接複製命令行界面中輸出的token後面的字符串(紅
劃掉的部分
...]