hack のためのネタ帳, etc,,,

インストール

基本的に以下のコマンドで OK
pip3 install jupyter
ただし、pyzmq が Cygwin を linux と誤認するらしく、linux/tipc.h が見つからないと言われて、以下のように失敗する。

$ pip3 install jupyter

これは Cygwin のパッケージに python3-zmq が用意されているので、事前にこちらを入れておけば問題なかった。

実行

基本的には
jupyter notebook
で良いのだが、ブラウザが lynx になってしまう。

以下のようにすると、~/.jupyter/jupyter_notebook_config.py が生成されるので、c.NotebookApp.browser に好みのブラウザを設定しておくと良いと言う話。
jupyter notebook --generate-config
しかし、当該の部分を見ると
## Specify what command to use to invoke a web browser when opening the notebook
.
#  If not specified, the default browser will be determined by the `webbrowser`
#  standard library module, which allows setting of the BROWSER environment
#  variable to override it.
#c.NotebookApp.browser = ''
のように書かれているので、
export BROWSER=cygstart
jupyter notebook
または
BROWSER=cygstart jupyter notebook
とすれば、config を生成せずとも十分であった。
~/.bashrc に BROWSER 環境変数を設定しておいても良いだろう。

参考

コメントをかく


「http://」を含む投稿は禁止されています。

利用規約をご確認のうえご記入下さい

Wiki内検索

フリーエリア

管理人/副管理人のみ編集できます