symbolic
symbolic copied to clipboard
should `sympref diagnose` list possible Python interpreters for the user to choose?
In a recent Help-Octave thread, a user was confused that the Python they thought they had in /usr/bin isn't found by Octave. The problem turned out to be that they are running a confined Octave with Flatpak, so /usr/bin isn't what they normally expect it to be.
Would it be helpful for sympref diagnose
to list possible Pythons to choose from if it fails the first step of not finding Python? Or would it just be more noise and more confusion?
Here's an example of what I'm thinking of adding
$ /usr/bin/python3.8 -V
Python 3.8.2rc2
$ flatpak run --arch=x86_64 --branch=stable org.octave.Octave --silent
>> setenv PYTHON python3.8
>> pkg load symbolic
>> sympref diagnose
Symbolic package diagnostics
============================
Python and SymPy are needed for most features of the Symbolic package.
The Python interpreter is currently: "python3.8".
Computers may have more than one Python interpreter installed. If you
need to, you can select a different one using the PYTHON environment
variable (see "help sympref"). For example, to use Python 3, try
setenv PYTHON python3
sympref reset
Attempting to run python3.8 -c "print(\"Python says hello\")"
sh: python3.8: command not found
status = 127
output =
Unfortunately, that command failed!
We expected to see "status = 0" and "output = Python says hello".
* Is there an error message above?
* Do you have Python installed?
* Please try using "setenv" as described above.
* Most systems search the PATH environment when looking for commands.
Your path seems to be:
/app/bin:/usr/bin:/app/jre/bin:/app/libexec/octave/5.2.0/site/exec/x86_64-pc-linux-gnu:/app/libexec/octave/api-v53/site/exec/x86_64-pc-linux-gnu:/app/libexec/octave/site/exec/x86_64-pc-linux-gnu:/app/libexec/octave/5.2.0/exec/x86_64-pc-linux-gnu:/app/bin
The path includes the following Python interpreters:
- /usr/bin/python3
- /usr/bin/python3.7
- /usr/bin/python3.7m
Useful?
From the original poster
What was confusing in the diagnostic process for me was that the path variable said usr/bin is in the path, while the sympref diagnose said changing the path would be one of the things that could help.
Which makes me think, because I don't see anything in the diagnose
output that says that I should change the path. Maybe we can also reword something to make it clearer that we are not expecting the user to change PATH in response?