Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using Gnome 2.32.0 in Ubuntu 10.10 and I need to execute a Python script via Gnome custom application launcher. I added an application launcher to the panel and pointed the relevant Python script, but every time I try to run it, I get an error message along these lines:

There was an error creating the child process for this terminal
Failed to execute child process "/home/dananjaya/xkcd_viewer/" (Permission denied)

What is the correct way of adding a Python script to the application launcher? What is wrong in this case? Thank you in advance.

share|improve this question
up vote 1 down vote accepted

It seems like you don't have permissions to execute the script. There are two possible solutions:

  1. Prefix the command with python, e. g. python /path/to/ instead of /path/to/ That way, the python interpreter will read your script instead of the executed script calling the python interpreter, and the permissions on the script may stay the same.

  2. Enable execution-permissions for the script. Right-click the script in the file manager, choose properties and tick the execution permission under the permissions tab. This solution implies that your script can be identified by the shell as a python-script. To do this, you must place #!/usr/bin/env python on the first line of the file.

share|improve this answer
Thank you for you suggestions and I tried both of them. I enabled the execution-permission. also did prefix the command with 'python'. Now it doesn't give the aforementioned error but does nothing at all. I looked at all the processes running and the script does not run. – Dananjaya Apr 22 '11 at 14:21
It sound like you have other bugs. It might be caused by the script running with another working directory instead of its main directory. Try running the exact same command as the launcher in a terminal and see if you get any exceptions. – Egil Apr 22 '11 at 15:31
No exceptions occur. Script runs okay in the terminal. – Dananjaya Apr 22 '11 at 16:04
I cloned your repository and got gnome-terminal -e "python /home/egil/src/xkcd_viewer/" to work as launcher. However, I cannot understand why executing the script directly yields a cross-hair. – Egil Apr 22 '11 at 19:58
Of course, you lack the shebang at the start of your script. The first line should read #!/usr/bin/env python. The crosshair comes from the import command that gets executed because your script gets read as a batch of commands as it lacks the shebang that explains that it must be executed with python. – Egil Apr 23 '11 at 8:45

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.