I have just written my first python macro (in fact my first macro)...when I compile it in Geany (using Buld Compile), I get the answer /usr/bin/python3 (in directory:
/home/yodap/.config/libreoffice/4/user/Scripts/python/PythonLibray) Compilation finished successfully.
Yet when I execute it (using Build execute) I get the following output: /tmp/geany_run_script_PRBZ81.sh: 7: python: not found
------------------ (program exited with code: 127)
What have I done wrong?...and how can I fix it please!
On Thu, 27 Jul 2023 at 17:07, dunbrokin--- via Users users@lists.geany.org wrote:
I have just written my first python macro (in fact my first macro)...when I compile it in Geany (using Buld Compile), I get the answer /usr/bin/python3 (in directory:
/home/yodap/.config/libreoffice/4/user/Scripts/python/PythonLibray) Compilation finished successfully.
Yet when I execute it (using Build execute) I get the following output: /tmp/geany_run_script_PRBZ81.sh: 7: python: not found
You have a PATH problem. That can be complex to debug.
Probably simplest to use `Set Build Commands` to change the execute command to the full path `/usr/bin/python3`.
Cheers Lex
(program exited with code: 127)
What have I done wrong?...and how can I fix it please! _______________________________________________ Users mailing list -- users@lists.geany.org To unsubscribe send an email to users-leave@lists.geany.org
Thank you for that...it worked!
On Thu, Jul 27, 2023 at 8:00 PM Lex Trotman via Users users@lists.geany.org wrote:
On Thu, 27 Jul 2023 at 17:07, dunbrokin--- via Users users@lists.geany.org wrote:
I have just written my first python macro (in fact my first
macro)...when I compile it in Geany (using Buld Compile), I get the answer /usr/bin/python3 (in directory:
/home/yodap/.config/libreoffice/4/user/Scripts/python/PythonLibray) Compilation finished successfully.
Yet when I execute it (using Build execute) I get the following output: /tmp/geany_run_script_PRBZ81.sh: 7: python: not found
You have a PATH problem. That can be complex to debug.
Probably simplest to use `Set Build Commands` to change the execute command to the full path `/usr/bin/python3`.
Cheers Lex
(program exited with code: 127)
What have I done wrong?...and how can I fix it please! _______________________________________________ Users mailing list -- users@lists.geany.org To unsubscribe send an email to users-leave@lists.geany.org
Users mailing list -- users@lists.geany.org To unsubscribe send an email to users-leave@lists.geany.org
Hey there,
dunbrokin--- via Users wrote:
Yet when I execute it (using Build execute) I get the following output: /tmp/geany_run_script_PRBZ81.sh: 7: python: not found
(program exited with code: 127)
I don't know anything about compiling Python macros, but this message happens because we no longer use the "python" command and are, instead, using the "python3" command. To fix it:
1. Open a Python file in Geany. 2. Open the "Build" menu. 3. Choose "Set Build Commands" from the menu. 4. Check which command is shown in the "Command" column in the "Execute" row. 5. If it says this: python "%f" Edit it and change it to: python3 "%f" 6. Click the "OK" button.
That should do it.
On Thu, 27 Jul 2023 at 21:04, Little Girl via Users users@lists.geany.org wrote:
Hey there,
dunbrokin--- via Users wrote:
Yet when I execute it (using Build execute) I get the following output: /tmp/geany_run_script_PRBZ81.sh: 7: python: not found
(program exited with code: 127)
I don't know anything about compiling Python macros, but this message happens because we no longer use the "python" command and are, instead, using the "python3" command. To fix it:
- Open a Python file in Geany.
- Open the "Build" menu.
- Choose "Set Build Commands" from the menu.
- Check which command is shown in the "Command" column in the
"Execute" row. 5. If it says this: python "%f" Edit it and change it to: python3 "%f" 6. Click the "OK" button.
That should do it.
The question is why does the python compile work but not the execute?
Did the OP change compile but not change the execute for some reason?
Or is there an issue of PATH due to the different ways compile commands and execute commands are run.
And anyway, why did the distro packager not use --with-python-command=... when building the package so it will work for their users (Geany 1.38 or later but the OP didn't say what version they had)?
ahh well [end rant]
-- Little Girl
There is no spoon. _______________________________________________ Users mailing list -- users@lists.geany.org To unsubscribe send an email to users-leave@lists.geany.org
Hey there,
Lex Trotman via Users wrote:
The question is why does the python compile work but not the execute?
Did the OP change compile but not change the execute for some reason?
Or is there an issue of PATH due to the different ways compile commands and execute commands are run.
No idea on any of those, especially since I had no idea that Python could even be compiled.
And anyway, why did the distro packager not use --with-python-command=... when building the package so it will work for their users (Geany 1.38 or later but the OP didn't say what version they had)?
ahh well [end rant]
Interesting. I didn't realize they could. You'd think they would have realized it and done exactly that. It wouldn't surprise me if it's because they have so many thousands of programs that they take a hands-off approach when it comes to packaging.
Anyway, my apologies for jumping in on this thread when I did. I had only received the OP's message when I sent my reply. It wasn't until later that the rest of the messages came in even though they were time-stamped earlier than mine and the problem had already been solved. It's one of those occasional internet burps, I suppose, but my intentions were good.
A nice side-effect of this for me was that I poked around in the Build menu and ended up messing around with and customizing the Lint command. I'm loving the way that Geany highlights an offending line if you click on it in the "Compiler" panel. It's simply glorious. This program just gets better and better and better the more you use it.
On Thu, 27 Jul 2023 at 23:07, Little Girl via Users users@lists.geany.org wrote:
Hey there,
Lex Trotman via Users wrote:
The question is why does the python compile work but not the execute?
Did the OP change compile but not change the execute for some reason?
Or is there an issue of PATH due to the different ways compile commands and execute commands are run.
No idea on any of those, especially since I had no idea that Python could even be compiled.
https://docs.python.org/3/library/py_compile.html#command-line-interface
See default Geany Python "Compile" command for example.
And anyway, why did the distro packager not use --with-python-command=... when building the package so it will work for their users (Geany 1.38 or later but the OP didn't say what version they had)?
ahh well [end rant]
Just to be sure, the rant was at the world in general, not you specifically.
Interesting. I didn't realize they could. You'd think they would have realized it and done exactly that. It wouldn't surprise me if it's because they have so many thousands of programs that they take a hands-off approach when it comes to packaging.
Or possibly they didn't notice since it was only added in 1.38
Anyway, my apologies for jumping in on this thread when I did. I had only received the OP's message when I sent my reply. It wasn't until later that the rest of the messages came in even though they were time-stamped earlier than mine and the problem had already been solved. It's one of those occasional internet burps, I suppose, but my intentions were good.
Ahh yes, good old not guaranteed delivery email.
A nice side-effect of this for me was that I poked around in the Build menu and ended up messing around with and customizing the Lint command. I'm loving the way that Geany highlights an offending line if you click on it in the "Compiler" panel. It's simply glorious. This program just gets better and better and better the more you use it.
See also article in the Geany wiki https://wiki.geany.org/howtos/configurebuildmenu
-- Little Girl
There is no spoon. _______________________________________________ Users mailing list -- users@lists.geany.org To unsubscribe send an email to users-leave@lists.geany.org
Hey there,
Lex Trotman via Users wrote:
Little Girl via Users wrote:
I had no idea that Python could even be compiled.
https://docs.python.org/3/library/py_compile.html#command-line-interface
See default Geany Python "Compile" command for example.
Interesting. Thank you. Learn something new every day.
Just to be sure, the rant was at the world in general, not you specifically.
Yep. No worries.
Interesting. I didn't realize they could. You'd think they would have realized it and done exactly that. It wouldn't surprise me if it's because they have so many thousands of programs that they take a hands-off approach when it comes to packaging.
Or possibly they didn't notice since it was only added in 1.38
That's the version of Geany I'm using in Kubuntu 22.04 LTS, so here's hoping they discover and use it for the next OS release. Meanwhile, I'll keep my notes on how it's done.
See also article in the Geany wiki https://wiki.geany.org/howtos/configurebuildmenu
Thank you. Also very interesting and informative.