インタラクティブプログラミング-jupyter notebook

1588 ワード

インストール
  • 新しい仮想環境Python仮想環境virtualenvwrapperインストール構成(オプション)
  • mkvirtualenv jupyter -p python3
    
  • Pip取付
  • pip3 install jupyter
    
  • 起動
  • jupyter notebook --no-browser --port 8888
    

    リモート・アクセスの構成
  • デフォルトプロファイル
  • を生成する.
    #     path  ~/.jupyter/jupyter_notebook_config_backup.py
    jupyter notebook --generate-config
    
  • パスワード設定
  • 方法1
  • jupyter notebook password
    Enter password: #    ,    
    Verify password:            #        
    #      ~/.jupyter/jupyter_notebook_config.json 
    
  • 方法2
  • ipython
    In [1]: from notebook.auth import passwd
    In [2]: passwd()
    Enter password:
    Verify password:
    Out[2]: '************'
    
  • メソッド1ファイルのpasswordまたはメソッド2の出力をコピーする暗号文字列
  • 編集​~/.jupyter/jupyter_notebook_config_backup.py
  • 加入
    c.NotebookApp.ip = '*'
    c.NotebookApp.password = u'***...         '
    c.NotebookApp.open_browser = False
    c.NotebookApp.port =8888  #         ,         
    
  • 起動
  • バックグラウンドで起動し、スクリプト~/cmd/jupyterを作成する.sh​
  • cd /home/user_name
    [python_path]/bin/jupyter notebook > jupyter.log  2>&1 &
    
  • 別名構成​~/.bash_profile​
  • を加える.
    alias jupyter="bash ~/cmd/jupyter.sh"
    
  • 有効エイリアス構成
  • source ~/.bash_profile
    
  • バックグラウンド起動
  • jupyter
    
  • Kill
  • lsof -i:8888
    kill  -9 [pid]