Score:0

"/tmp/geany_run_script_SO5U41.sh: 7: python: not found" - F5 key doesn't execute script in geany

fo flag

I'm using Geany for the first time. I'm trying to run the sample script I've written (please see screenshot 1) by pressing F5 - normally, this should open the terminal and execute the code.

(According to the documentation, F5 'executes the current file in a terminal emulation'.)

However, I get the error:

/tmp/geany_run_script_SO5U4.sh: 7: python: not found

------------------
(program exited with code: 127)

Press return to continue

The text of the script was:

#!/usr/bin/env python 3

print('Python is awesome!')

The code works fine when executed directly from the terminal:

python3 sample_script.py

which outputs Python is awesome! as expected.

Any suggestions?

David avatar
cn flag
What version of Ubuntu are you using? Please do not show pictures of text. Cut and paste the text into the body of the question.
hr flag
Recent versions of Ubuntu require python to be invoked explicitly as either `python2` or `python3` - so you may need to go into the geany build commands menu and modify the "Execute" command from `python "%f"` to `python3 "%f"`. See also [python-is-python3 package in Ubuntu 20.04 - what is it and what does it actually do?](https://askubuntu.com/questions/1296790/python-is-python3-package-in-ubuntu-20-04-what-is-it-and-what-does-it-actually)
Vadim avatar
fo flag
@steeldriver I did exactly as you said and it now works, thank you!
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.