裏 RjpWiki

Julia ときどき R, Python によるコンピュータプログラム,コンピュータ・サイエンス,統計学

Jupyterlab で GNU Octave を使う @macOS

2022年07月08日 | Octave

Jupyterlab 側で用意することは唯一,octave kernel のインストール

$ pip install octave_kernel

macOS 用の GNU Octave は

GNU Octave にも手を出してみる
https://blog.goo.ne.jp/r-de-r/e/a59385acd2252786199f2c45663ffaeb

に書いたように,

https://github.com/octave-app/octave-app/releases

で Octave 6.2.0 がインストールされる。

しかし,アプリケーションアイコンは Octave 自身ではなく Octave の IDE 環境(?)のアプレット applet を指している。

Octave 自身は,

/Applications/Octave-6.2.0.app/Contents/Resources/usr/Cellar/octave-octave-app@6.2.0/6.2.0/bin/octave-6.2.0

にある。これに対して /usr/local/bin の中にシンボリックリンク octave を張る。

$ ln -s /Applications/Octave-6.2.0.app/Contents/Resources/usr/Cellar/octave-octave-app@6.2.0/6.2.0/bin/octave-6.2.0 /usr/local/bin/octave

/usr/local/bin にはパスが通っているはず(通っていなければ通す)なので,コマンドライン(プロンプト)から

$ octave

と入力すれば,octave の REPL ウインドウが開く。

GNU Octave, version 6.2.0
Copyright (C) 2021 The Octave Project Developers.
This is free software; see the source code for copying conditions.
There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  For details, type 'warranty'.

Octave was configured for "x86_64-apple-darwin18.7.0".

Additional information about Octave is available at https://www.octave.org.

Please contribute if you find this software useful.
For more information, visit https://www.octave.org/get-involved.html

Read https://www.octave.org/bugs.html to learn how to submit bug reports.
For information about changes from previous versions, type 'news'.

octave:1> 1+sqrt(8)
ans = 3.8284
octave:2> quit

これが終わったら Jupyterlab のカーネル Octave を選ぶだけだ。

 

コメント
  • X
  • Facebookでシェアする
  • はてなブックマークに追加する
  • LINEでシェアする

PVアクセスランキング にほんブログ村

PVアクセスランキング にほんブログ村