Skip to content

Commit

Permalink
Prefer octave-cli if available
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 committed Apr 15, 2024
1 parent 31238ac commit 2e03083
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ To install using conda::
conda install octave_kernel
conda install texinfo # For the inline documentation (shift-tab) to appear.

We require the ``octave`` executable to run the kernel.
We require the ``octave-cli`` or ``octave`` executable to run the kernel.
Add that executable's directory to the ``PATH`` environment variable or create the
environment variable ``OCTAVE_EXECUTABLE`` to point to the executable itself.
Note that on Octave 5 on Windows, the executable is in ``"Octave-5.x.x.x\mingw64\bin"``.
Note that on Octave 5+ on Windows, the executable is in ``"Octave-x.x.x.x\mingw64\bin"``.

We automatically install a Jupyter kernelspec when installing the
python package. This location can be found using ``jupyter kernelspec list``.
Expand Down
6 changes: 4 additions & 2 deletions octave_kernel/kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,9 +481,11 @@ def _get_executable(self):
if 'octave' not in executable:
raise OSError('OCTAVE_EXECUTABLE does not point to an octave file, please see README')
else:
executable = which('octave')
executable = which('octave-cli')
if not executable:
raise OSError('octave not found, please see README')
executable = which('octave')
if not executable:
raise OSError('octave not found, please see README')
return executable.replace(os.path.sep, '/')

def _cleanup(self):
Expand Down

0 comments on commit 2e03083

Please sign in to comment.