blink1073 / oct2py

Run M Files from Python - GNU Octave to Python bridge
http://blink1073.github.io/oct2py/
MIT License
261 stars 54 forks source link

Octave installed via flatpak is not found #323

Open bagustris opened 5 months ago

bagustris commented 5 months ago

The newest Octave usually is easier to install via Flatpak, but using this way oct2py cannot recognize the installed Octave.

I also already make an alias for octave to point octave installed from flathub and it can called directly from terminal using octave command. I also already updated my PATH to include binary of octave in flatpak (export PATH="/var/lib/flatpak/exports/bin:$PATH").

$ octave --version
GNU Octave, version 9.2.0
Copyright (C) 1993-2024 The Octave Project Developers.
This is free software; see the source code for copying conditions.
There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.

Octave was configured for "x86_64-pc-linux-gnu".

Home page:            https://octave.org
Support resources:    https://octave.org/support
Improve Octave:       https://octave.org/get-involved

$ ipython
Python 3.8.10 (default, Nov 22 2023, 10:22:35) 
Type 'copyright', 'credits' or 'license' for more information
IPython 8.10.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import oct2py
octave not found, please see README

In [2]: 

Is there any step to link the octave installed from Flatpak to this oct2py? I am using Ubuntu 20.4 with the latest Octave version 9.2.0 I suspect the error probably is caused by different names of binaries, i.e., octave vs org.octave.Octave

blink1073 commented 5 months ago

Hi @bagustris, have you tried setting OCTAVE_EXECUTABLE?

bagustris commented 5 months ago

There is no information how to set OCTAVE_EXECUTABLE. So, I assumed the following thing and it didn't work

(asd) bagus:~$ OCTAVE_EXECUTABLE='/var/lib/flatpak/exports/bin/org.octave.Octave' 
(asd) bagus:~$ python
Python 3.9.19 | packaged by conda-forge | (main, Mar 20 2024, 12:50:21) 
[GCC 12.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import oct2py
octave not found, please see README
>>>
blink1073 commented 5 months ago

From the README, "Alternatively, you can set an OCTAVE_EXECUTABLE or OCTAVE environment variable that points to octave executable itself.". Is /var/lib/flatpak/exports/bin/org.octave.Octave an executable file?

bagustris commented 5 months ago

Yes, it is executable. I can run octave cli mode from that file.

$ /var/lib/flatpak/exports/bin/org.octave.Octave
QSocketNotifier: Can only be used with threads started with QThread
qt.qpa.qgnomeplatform: Could not find color scheme  ""
GNU Octave, version 9.2.0
Copyright (C) 1993-2024 The Octave Project Developers.
This is free software; see the source code for copying conditions.
There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  For details, type 'warranty'.

Octave was configured for "x86_64-pc-linux-gnu".

Home page:            https://octave.org
Support resources:    https://octave.org/support
Improve Octave:       https://octave.org/get-involved

For changes from previous versions, type 'news'.

octave:1> 
blink1073 commented 5 months ago

I'm not sure then, I'm not familiar with flatpack.