A Python application (having a permission to be executed by the user) doesn't start with double click on it. If I run it (directly, by ./theapp.pyw) in terminal I get ": No such file or directory" error (while there is no such a string in the application code and the file surely exists (renaming it and using a different name results in the same)).
But If I explicitly open it with Python (by issuing python ./theapp.pyw or right-clicking and choosing to open with Python 2.7) it works just fine.
The first line of the file says
#!/usr/bin/env python
Issuing "/usr/bin/env python" command launches Python 2.7 console.
The OS is XUbuntu Linux 11.10. The only Python installed is Ubuntu's default 2.7.
Any ideas?