Unable to run a octave function using oct2py through the web server
NickName:amathur Ask DateTime:2016-11-20T23:07:07

Unable to run a octave function using oct2py through the web server

I am using oct2py to call a octave function in my python code. The file is saved as .py file in the htdocs folder.

#!/usr/bin/python
import cgi
import oct2py
from oct2py import octave
print('Content-type:text/html\r\n\r\n')
print('<!DOCTYPE html>')
firnum='23'
secnum='33'
octave.addpath('/Applications/XAMPP/xamppfiles/htdocs/mypython/Octavemfiles/')
firnum=int(firnum)
secnum=int(secnum)
answer=octave.mymultfunct(firnum,secnum)
print(answer)

The code works well when executing from the terminal and gives the answer. But when I call it through the web, the oct2py gives an error stating

OSError: Octave Executable not found, please add to path or set"OCTAVE_EXECUTABLE" environment. 

Please suggest a way out so I can call the function from octave. The octave function is just multiplying the numbers.

Copyright Notice:Content Author:「amathur」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/40705604/unable-to-run-a-octave-function-using-oct2py-through-the-web-server

More about “Unable to run a octave function using oct2py through the web server” related questions

Unable to run a octave function using oct2py through the web server

I am using oct2py to call a octave function in my python code. The file is saved as .py file in the htdocs folder. #!/usr/bin/python import cgi import oct2py from oct2py import octave print('Content-

Show Detail

Octave isnan: not defined error using oct2py

Using oct2py to call corrcoef.m on several (10MM+) size dataframes to return [R,P] matrices to generate training sets for a ML algorithm. Yesterday, I had this working no problem. Ran the script f...

Show Detail

oct2py - Calling an octave function using threads in python

I was trying to call an Octave function from a python program using two threads. My octave code is just to see how it works - testOctave.m function y = testOctave(i) y = i; end And the python

Show Detail

oct2py in Anaconda/Spyder not recognizing octave

Windows7 Anaconda/python ver 3.4 Octave ver 4.0.3 OCTAVE_EXECUTABLE = C:\Users\Heather\Octave-4.0.3\bin Hi all, I've been working a few days on trying to get oct2py working in Anaconda using ...

Show Detail

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...

Show Detail

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:

Show Detail

Close Octave-cli instances while using Oct2Py in loop

So I'm running into an increasingly annoying problem while using Oct2Py in my python code to run a few Matlab codes. Every time I run Oct2py in my script it opens in my processes an octave-cli.exe ...

Show Detail

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

Show Detail

get data from octave script execution using oct2py (python3)

I'm trying to execute some Matlab scripts (not a function definition) from Python 3 using oct2py module. Those scripts (a large amount) contains a very extended definition to read a specific ASCIII

Show Detail

How do I add Octave to my PATH to use oct2py?

Final edit: adding export PATH=/usr/local/octave/3.8.0/bin:$PATH to my path was indeed sufficient to enable oct2py to work properly (so long as I restarted my terminal after the change). Huzzah!...

Show Detail