Reputation: 147
I have installled oct2py and I can import octave in shell interactive python3 mode.
lukas@lukas-VirtualBox:~$ python3
Python 3.5.2 (default, Sep 14 2017, 22:51:06)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from oct2py import octave
>>> octave.exp(1*2)
7.38905609893065
>>>
But I cannot import octave in python3 script.
#!/usr/bin/env python3
import oct2py
from oct2py import octave
First line (import oct2py) is with no error. Second line produces error:
File "/home/lukas/detection/octave/oct2py.py", line 4, in <module>
from oct2py import octave
ImportError: cannot import name 'octave'
I have found topics here about this but nothing mentioned solved my problem. I have set octave to PATH:
export PATH=/usr/bin/octave:$PATH
No results It cannot import octave in script, just in the interactive mode.
I use Ubuntu 16.04.3 LTS, Octave 4.0.0, Python3, Scipy 0.17.0
Upvotes: 1
Views: 538