Octave in Ubuntu

关于Ubuntu16.04LTS下Octave的安装和使用。

安装

sudo add-apt-repository ppa:octave/stable
sudo apt-get update
sudo apt-get install octave

参考这里

之后运行报错:

The settings file /home/user/.config/octave/qt-settings does not exist and can not be created.
Make sure you have read and write permissions to /home/user/.config/octave Octave GUI must be closed now.

解决办法:

cd .config/octave
sudo chown user qt-settings

其中user改为自己的用户名。chown为更改拥有者的命令。

参考这里

使用
安装包

安装包的下载列表在这里,直接下载即可。

尝试:

pkg install /home/shensir/Documents/MyPrograming/octave/struct-1.0.14.tar.gz

报错:

pkg: please install the Debian package “liboctave-dev” to get the mkoctfile command
error: called from ‘gripe_missing_component‘ in file /usr/share/octave/4.0.2/m/help/gripe_missing_component.m near line 53, column 3

解决报错:

sudo apt-get install liboctave-dev

安装成功:

For information about changes from previous versions of the struct package, run ‘news struct’.

查看已经安装的包:

pkg list

Package Name | Version | Installation directory
optim | 1.5.0 | /home/shensir/octave/optim-1.5.0
struct | 1.0.14 | /home/shensir/octave/struct-1.0.14
symbolic | 2.5.0 | /home/shensir/octave/symbolic-2.5.0

调用安装的包:

pkg load symbolic
sym x

嗯,报错了。。。

Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named sympy
OctSymPy v2.5.0: this is free software without warranty, see source.
Initializing communication with SymPy using a popen2() pipe.
error: Python cannot import SymPy: have you installed SymPy?
error: called from
    assert_have_python_and_sympy at line 37 column 5
    python_ipc_popen2 at line 78 column 5
    python_ipc_driver at line 58 column 13
    python_cmd at line 164 column 9
    sym at line 340 column 9

貌似说python没有装sympy,检查了下,已经装了。注意到可能是Python路径设置的问题,就查了查官方给的symbolic的文档.

  * The environment variable `PYTHON` controls which Python executable is
    used.  The command
         `sympref python C:\bin\python`
    has been deprecated; instead please use:
         `setenv PYTHON C:\bin\python`

于是[这里用的anaconda]:

setenv PYTHON /home/shensir/anaconda3/bin/python

搞定。

本文标题:Octave in Ubuntu

文章作者:不秩稚童

发布时间:2017年05月06日 - 23:10:53

最后更新:2017年08月01日 - 01:24:49

原始链接:http://datahonor.com/2017/05/06/Octave-IN-Ubuntu/

许可协议: 署名-非商业性使用-禁止演绎 4.0 国际 转载请保留原文链接及作者。

击蒙御寇