0

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?

Vadim
  • 139
  • 5
  • 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. – David May 04 '23 at 16:50
  • 1
    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) – steeldriver May 04 '23 at 17:19
  • @steeldriver I did exactly as you said and it now works, thank you! – Vadim May 05 '23 at 07:51

0 Answers0