Unable to run Geany (v1.36) in Ubuntu 20.04.1

After loading a Python program into Geany (v1.36) under Ubuntu 20.04.1, it won’t run after pressing F5 and the following error message appeared in the terminal window:

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

It worked fine until I upgraded from Ubuntu 18.04.5 to 20.04.1 approximately six weeks ago. How may I resolve this? Thanking you all in advance for any solution(s).

Ken Green

That’s what’s missing.

Depending on what Python version this script requires you need to install one of the following:

Python 3

sudo apt install -y python3

Python 2

sudo apt install -y python2

Thank you. Your suggestion of installing Python 3 resulted in its already being installed. However, Python 2 got installed. Strange, but Python 2 and 3 are already listed in the hard drive. Ran Geany and still got the same message as I already stated before with the exception of 7S11U0 displayed for Python 2 and N0AAV0 for Python 3.

Insert this command into the 3rd line of your script and run it afterwards:

echo -e ${PATH//:/\\n}

In order to execute the program, Geany calls the python command:

#~ EX_00_CM=python "%f" where %f is the filename.

If you want to find out, what the command means, try
ls -l /usr/bin/python.

In my case, I get
lrwxrwxrwx 1 root root 7 Apr 15 2020 /usr/bin/python -> python2*

If you don’t get anything, i.e. the python command is undefined, you can link it to one of the Python versions installed on your system, e.g. with

mina@rechner:~$ sudo ln -s /usr/bin/python3 /usr/bin/python

1 Like

Though, this is usually always done automatically, on installation. If it is not symlinked, something is probably wrong here.

1 Like

Hey, that last entry of “sudo ln -s /usr/bin/python3 /usr/bin/python”
did the trick. THANKS! The entry of “;s -l /usr/bom/python” did came up with a similar entry such as yours. Again, mucho thanks.

Ken

1 Like

Thanks but I am not familiar with the placement of script(s) in the computer. However, due to the suggestion from another use, there were no link to python anywhere. Hey, thanks for your response.

Ken

Yes, there was no linkage. Due to another user, I was able to make a link. Thanks for your response.

Ken