Questions tagged [oct2py]

Oct2Py is a Python library that allows the user to seamlessly call M-files and Octave functions from Python.

Oct2Py is a Python library which allows for seamless integration between Python and Octave. It manages the Octave session for you and transfers data between Python and the Octave session using MAT files.

Additionally, it provides OctageMagic which allows for integration of Oct2Py into Jupyter notebooks.

Example

from oct2py import Oct2Py

# Create an Octave session
oc = Oct2Py()

# Call an Octave function
x = oc.zeros(3, 3)

print(x, x.dtype)

#   [[ 0.  0.  0.]
#    [ 0.  0.  0.]
#    [ 0.  0.  0.]] float64

References

56 questions
1
vote
0 answers

oct2py import successful, any calls to oct2py crashes python

I added C:\Octave\Octave-4.0.1\bin to my PATH and can successfully import oct2py, but subsequent calls to oct2py crashes the python kernel. The kernel crashes in command line python, IPython and Spyder. Sample code: from oct2py import Oct2Py #…
Josh
  • 21
  • 5
1
vote
2 answers

oct2py - cannot import name 'octave' when using spyder IDE

I have python 3.4.3 and octave 3.6.4 installed on my computer. I installed oct2py 3.30 through the command pip install oct2py and there were no errors shown, but when I try to run: import numpy as np from oct2py import octave I get the following…
AX2
  • 43
  • 6
1
vote
0 answers

installing GNU octave for use in python oct2py

I am trying to install GNU octave for use in python oct2py. I have been using octave 3.6.4 alone for several months without problems but I cannot call functions octave scripts from python. While in python: import oct2py I get the error message: …
user3062260
  • 1,584
  • 4
  • 25
  • 53
1
vote
1 answer

matrix multiplication with oct2py

I am using oct2py to run octave function with python. It is working but I get an error when I try to multiply 2 matrix. What can I do to solve the problem? this is a sample matlab funcion %% MATLAB function lol = jk2(arg1,arg2) arg1 = arg1; …
Donbeo
  • 17,067
  • 37
  • 114
  • 188
0
votes
1 answer

Fail to setup octave magic commands on Google Colab: module 'oct2py' has no attribute 'octave'

I am trying to draft a MATLAB/Octave tutorial on Google Colab, and was hoping to use magic commands %octave and %%octave to write most of the cells. However, when I tried to setup the environment using the below commands !apt-get install octave !pip…
FangQ
  • 1,444
  • 10
  • 18
0
votes
1 answer

warnings when running octave from python

I am using oct2py python library to run octave script but I get the following error that I don't understand: warning: function C:\Program Files\GNU Octave\Octave-7.3.0\mingw64\share\octave\packages\statistics-1.5.0\shadow\mean.m shadows a core…
Wallflower
  • 550
  • 1
  • 4
  • 13
0
votes
1 answer

Why do I get the following error when I try to import oct2py?

The error occurs when I try to import the oct2py package. Here's my code: import oct2py Here's the error that I get: Traceback (most recent call last): File "c:\Users\samke\___\___\___\test.py", line 1, in # I blanked out the path for…
0
votes
1 answer

Octave notebook shows in Jupyter but can't connect to kernel

I have tried to use Octave through Jupyter(Anaconda)(NOT USING PIP) but it's not working. initially I was able to install octave using conda(fig 1showing octave in juoyter, but was keep getting getting the error "Octave-cli" not found. so I tried to…
0
votes
0 answers

pkg 'make' error while installing control package in GNU - Octave 6.2.0

I am trying to install the signal package, which in turn requires the control packge. However, I am getting the following error when trying to install the control package on the octave terminal: octave:2> pkg install -forge signal error: the…
0
votes
3 answers

Error when trying to install oct2py package

I am trying to install to oct2py package to import in my python script. However whenever I run the command pip install oct2py I get the following error: Fatal error in launcher: Unable to create process using '"c:\python37\python.exe" "C:\Program…
Wallflower
  • 550
  • 1
  • 4
  • 13
0
votes
1 answer

"exists_or_mkdir" undefined after using Oct2Py on *.m (Matlab) file in Google Colab

I've been trying to figure out how to run Matlab files in Google Colab. I've installed Octave (apt install Octave) into my Colab. But trying to run my .m file with !octave -W make_video.m then just returned parse error near line 91 of file…
m0a
  • 1,005
  • 2
  • 15
  • 29
0
votes
0 answers

Error with oct2py when the octave function have load param

I'm using oct2py to call a octave function in my python code. Everything should be OK, and the octave function exectuted with octave works but when I call the function with python I have this error: import os pathToExecutable =…
0
votes
1 answer

How can i change the import timeout limit (python2.7 and oct2py)

I am trying to import octave, but it timeouts; not always but most of the time. Is there any solution? How can i change the timeout-limit of the import command? In my script i have only the following line: from oct2py import octave I get the…
0
votes
1 answer

Import oct2py says access is denied

I have installed Python anaconda environment, and installed oct2py using (D:\Anaconda2) C:\Users\BNP>conda install -c conda-forge oct2py When I try to import oct2py from anaconda prompt, it doesn't show any error Anaconda prompt: But when I try…
Bhakti
  • 13
  • 7
0
votes
2 answers

oct2py Import error: the system cannot find the file specified

I'm trying to use oct2py in one of my python scripts, I have octave installed in C:\Octave\Octave-4.2.1 and have added C:\Octave\Octave-4.2.1 to my PATH variable for my user account. When I run from oct2py import octave I get the following…
user5628280