文中涉及的Octave包不多,但是可以作为一个举一反三的例子。
喵哥在Octave中执行脚本时,遇到软件缺少包无法执行“pdist”函数。
warning: the 'pdist' function belongs to the statistics package from Octave Forge
which seems to not be installed in your system.
Please read <http://www.octave.org/missing.html> to learn how youcan
contribute missing functionality.
在https://stackoverflow.com/questions/18862354/octave-pdist-pairwise-distance中提到要安装statistics包需要先
pkg install -forge io
但是,喵哥在执行这个命令的时候还是报错。参考了https://bugs.launchpad.net/ubuntu/+source/octave/+bug/1380199后,依次在终端执行
sudo apt-get install octave-general
sudo apt-get install liboctave-dev
然后在Octave执行
pkg install -forge io
在终端执行
sudo apt-get install octave-statistics
在Octave执行
pkg install -forge -nodeps statistics
然后在需要用到statistics包里的函数时,就在Octave执行
pkg load statistics
或者在脚本中加入这个载入命令。