0
votes

I am receiving this error when trying to run my .m script in an Octave Jupyter Notebook on Ubuntu 16.04:

warning: Functions for spreadsheet style I/O (.xls .xlsx .sxc .ods .dbf .wk1 etc.) are provided in the io package. See http://octave.sf.net/io/.

Please read http://www.octave.org/missing.html to learn how you can contribute missing functionality. warning: called from unimplemented at line 524 column 5 calc_slope_per_year at line 7 column 8 error: 'xlsread' undefined near line 7 column 10 error: called from calc_slope_per_year at line 7 column 8

I originally didn't have the package io installed, so I installed it, but still receive the same error. Verified here:

Package Name | Version | Installation directory --------------+---------+----------------------- io | 2.4.10 | /home/m/octave/io-2.4.10

Here is my kernelspec list:

$ jupyter kernelspec list
Available kernels:
  python3    /home/m/.local/share/jupyter/kernels/python3
  ir         /home/m/anaconda2/share/jupyter/kernels/ir
  octave     /home/m/anaconda2/share/jupyter/kernels/octave
  python2    /home/m/anaconda2/share/jupyter/kernels/python2

I have also tried to use oct2py in a Python 3 Jupyter Notebook:

from oct2py import octave

but receive the same error

Oct2PyError: Octave evaluation error: error: 'xlsread' undefined near line 7 column 10 error: called from: calc_slope_per_year at line 7, column 8

Interestingly, when I ran my .m script in the Octive GUI without io package installed yet, it worked fine. Any Suggestions?

1
have you tried a pkg load io before trying to use xlsread? - Andy
That was what I was missing, thanks @Andy! Do you know why Octave was able to run the .m script without installing or loading io? Did I miss a blanket package install step when setting up my Jupyter Octave Notebook? - Mat S
perhaps you have a .octaverc where you do pkg load io - Andy

1 Answers

0
votes

After following the advice of Andy's comment, pkg load io in the Octave Jupyter Notebook did the trick.

If you run the pkg list command, it will list the package and show whether the pkg is loaded or not:

If it is installed but not loaded, there won't be an * next to io.

Package Name | Version | Installation directory
io | 2.4.10 | /home/m/octave/io-2.4.10

If it is installed and loaded, there will be an * next to io.

Package Name | Version | Installation directory
io *| 2.4.10 | /home/m/octave/io-2.4.10

Also, if I load the io package in my Octave Jupyter notebook, it unloads it from the Octave program and visa versa.

Might be getting off topic here for a new question but is there a way to load it permanently for both instances?