Linux下配置jupyter-notebook

  1. 安裝pippython

    Linux系統都有Python,因此只要安裝pip就好
    
     sudo yum install python-pip
  2. 升級pipvim

    默認的pip不是最新版本,建議升級成最新,方面後期安裝一些使用的包
    
      sudo pip install --upgrade pip
  3. 安裝一些默認開發軟件瀏覽器

sudo yum groupinstall 'Development Tools'tcp

  1. 安裝jupyter命令行

    sudo pip install jupyter
  2. 修改配置文件3d

    (a) 在我的帳戶下創建配置文件:jupyter notebook --generate-config
    
      (b) Python環境下設置密碼:
>>> from notebook.auth import passwd

>>> passwd()

Enter password:

Verify password:

'sha1:d66351142f0a:9eea3d7f99e434a6837f5e73af18d03cf0353392'(複製此行密碼)

>>> ctrl+z
(c) 打開jupyter notebook --generate-config文件:

               vim /home/***(用戶名)/.jupyter/jupyter_notebook_config.py

     (d) 修改#c.NotebookApp.password = u'',改後注意去掉「#」

               u’’改成:u’sha1: d66351142f0a:9eea3d7f99e434a6837f5e73af18d03cf0353392’

修改c.NotebookApp.ip = '*'rest

修改c.NotebookApp.open_browser = Falsecode

修改c.NotebookApp.port = 8888(根據端口狀況修改) Linux下配置jupyter-notebookip

  1. 防火牆配置

firewall-cmd --zone=public --add-port=8888/tcp --permanent開發

sudo systemctl restart firewalld

  1. 運行notebook

命令行輸入:jupyter notebook

瀏覽器輸入:http://我的ip:8888/tree

相關文章
相關標籤/搜索