oct2py isn't seeing OCTAVE_EXECUTABLE environment variable (Windows)
oct2py run m-file
oct2py load package
oct2py install windows
So, I'm trying to use oct2py on Windows, like so:
from oct2py import octave
That's literally the only code I need to reproduce the error.
When I execute this, I get
OSError: Octave Executable not found, please add to path or set"OCTAVE_EXECUTABLE" environment variable. However, I have already set
OCTAVE_EXECUTABLE as a system variable, which points to
"C:\Octave\Octave-4.4.1\bin\octave-cli-4.4.1.exe". Opening up the command line and running
%OCTAVE_EXECUTABLE% gives me the Octave CLI, so I know it's right.
I've tried rebooting. I've also tried adding the Octave folder to my Path and removing
OCTAVE_EXECUTABLE. Neither work.
EDIT: I've also tried using just
octave-cli.exe, and I've tried doing
print(os.environ['OCTAVE_EXECUTABLE']), which returns the expected path.
Any ideas here?
There's two executables, octave-cli.exe and octave-cli-4.4.1.exe. What if you try the one without the version number? I only needed to restart the Spyder IDE for it to work
Oct2Py: Python to GNU Octave Bridge — Oct2Py 4.0.6 documentation, Oct2Py allows you to seamlessly call M-files and Octave functions from Python. Usage is as simple as: Documentation for the functions included in Oct2Py. oct2py isn't seeing OCTAVE_EXECUTABLE environment variable (Windows) Ask Question Asked 1 year, 4 months ago. Active 3 months ago. Viewed 2k times 2. So, I'm trying
The documentation (http://blink1073.github.io/oct2py/source/installation.html) mentions oct2py may in fact be tryin to find a file called octave.exe, not octave-cli.exe
Try modifying your OCTAVE_EXECUTABLE to point to that instead. Though, in theory, if octave.exe and octave-cli.exe both sit in the same directory, adding to path should have worked ... but try anyway!
Information — Oct2Py 4.0.6 documentation, ones) 'ones' is a built-in function Interactivity�. Oct2Py supports code completion in IPython, so once you have created a method, you can recall it� Oct2Py is a Python library that allows the user to seemlessly call M-files and Octave functions from Python.
In spite of what you mention in your comment:
It appears that, somewhere along the line, octave.exe got replaced with octave-cli.exe. There is no longer an octave.exe distributed with the Octave package. Others have successfully pointed OCTAVE_EXECUTABLE at octave-cli.exe
Recently more people had a similar issue and the
oct2py developers fixed it in the
5.0.0 version some hours ago. Actually they said:
Ah, I see what the issue is here. The convenience
octaveinstance is created before you get a chance to set the
executableproperty. Given that fact, I think the only right answer is to remove the executable argument in favor of using
Anyway I had to adapt my code to make it work updating the environment variable
import shutil import os import sys if sys.platform == 'win32': # os.environ['OCTAVE_EXECUTABLE'] = shutil.which('octave') # >> I had to replace this with this other line >> os.environ['OCTAVE_EXECUTABLE'] = shutil.which('octave-cli.exe')
blink1073/oct2py: Run M Files from Python - GNU Octave to , Usage is as simple as: >>> oc = oct2py.Oct2Py() >>>� oct2py, source code This is a neat module that is based on octave, which is an open-source matlab clone. It is analogous to “free MatLab” in a sense. There are tools, however, in MatLab by MathWorks that are not available in Octave.
Not sure if this will help so long after the OP, but here is what worked for me:
- Download Octave as a .7z file and unzip it to hard disk
- Run post-install.bat (from the folder entitled octave-5.2.0-w64 or something similar)
- Restart Windows 10 machine (due to messages encountered during run of post-install.bat)
- Run octave-firsttime.vbs
- Quit the Octave program
- Execute the following python code (in 3.7.6)
import os pathToExecutable = ( 'D:\\wherever\\you\\put\\this\\octave-cli.exe' ) os.environ['OCTAVE_EXECUTABLE'] = pathToExecutable from oct2py import octave
I was running into a problem because, first of all, I failed to comprehend that I needed to install an Octave interpreter (I thought
oct2py came with one) and then since I am not an administrator I figured I would never be able to install it, but I worked it out!
oct2py isn't seeing OCTAVE_EXECUTABLE environment variable , There's two executables, octave-cli.exe and octave-cli-4.4.1.exe. What if you try the one without the version number? I only needed to restart the� 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.
Run Matlab code from Python with oct2py, oct2py uses GNU Octave to run most .m code that doesn't call proprietary Matlab toolboxes. Shared memory (RAM) or disk (temporary file) is� oct2py uses the the octave_kernel for low level interaction, and I made a release of octave_kernel that should fix the problem.
Oct2Py :: Anaconda Cloud, Installers. Info: This package contains files in non-standard labels. conda install -c conda-forge/label/cf201901 oct2py conda install -c� The running of Octave files in Python can be achieved with the Oct2Py library. A lot of people would call Logistic Regression a classifier but in reality it isn’t. This will become clear as
oct2py, Run M Files from Python - GNU Octave to Python bridge. Repository. https:// github.com/blink1073/oct2py. Project Slug. oct2py. Last Built. 1 year, 2 months ago� On 10 July 2013 11:41, lyvic <[hidden email]> wrote: > I was looking for something similar a few months ago and decided to learn > python, write the GUI in python with Tkinter and use oct2py to communicate > with octave and run my .m-Files.
- Thank you for the suggestion... I've actually tried both, with no luck.
- @JohnChrysostom what about just octave.exe instead of octave-cli?
- It appears that, somewhere along the line, octave.exe got replaced with octave-cli.exe. There is no longer an octave.exe distributed with the Octave package. Others have successfully pointed OCTAVE_EXECUTABLE at octave-cli.exe. Thanks, though.
- @JohnChrysostom might still be worth a try creating a symbolic link (or renaming) from octave-cli.exe to octave.exe though. (PS. Great honour, your eminence. Big fan of the liturgy :p )
- So I am just getting into using Octave, for the first time ever...step 5 above might not be necessary. All I know is that it definitely does not cause an error with the import statement; I figured it might cause problems if both Python and GNU Octave were both calling the interpreter at the same time, but then again, maybe it wouldn't!