Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6156613
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T20:38:27+00:00 2026-05-23T20:38:27+00:00

I have at the top of the file #!/usr/bin/env python . So it should

  • 0

I have at the top of the file #!/usr/bin/env python. So it should work when I run the file? But it doesnt. It works when I use python file.py tho

#!/usr/bin/env python

import pygtk
pygtk.require('2.0')
import gtk 

class App1:
  def __init__(self):
    self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
    self.window.show()

  def main(self):
    gtk.main()

if __name__ == "__main__":
  app = App1()
  app.main()

Python Here is what happened:

jiewmeng@jiewmeng:/labs/projects/learnPython$ app1.py
app1.py: command not found
jiewmeng@jiewmeng:/labs/projects/learnPython$ ./app1.py
bash: ./app1.py: Permission denied
jiewmeng@jiewmeng:/labs/projects/learnPython$ ll
total 12
drwxr-xr-x 2 jiewmeng jiewmeng 4096 2011-07-16 22:08 ./
drwxr-xr-x 4 jiewmeng jiewmeng 4096 2011-07-16 21:45 ../
-rwxrwxr-x 1 jiewmeng jiewmeng  256 2011-07-16 22:05 app1.py*
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T20:38:27+00:00Added an answer on May 23, 2026 at 8:38 pm

    Chris makes an excellent suggestion in the comments to the question, and Peter’s answer covers what you should do if Chris’ suggestion doesn’t work and you are in the sudoer group on your system (i.e. if you can modify files other than those belonging to your user). What follows could be your next option.

    In a command shell, type:

    which python
    

    this command will tell you where your working installation of python is located. Then you can modify the shebang line in your python file accordingly. For example, on my system:

    $ which python
    /usr/bin/python
    

    thus my shebang would be:

    #!/usr/bin/python
    

    Be aware that this will make your file work on your system but it’s highly probable it will make it not runnable on other ones…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written a script in haskell named testscript with the following code: #!/usr/bin/env
I have a linker command file that assigns the top address of the stack
At the top of my file I have PHP Code: if (!ISSET ($_POST['submit'])) which
Suppose I have a top-level ResourceDictionary element in a XAML file with no C#
I have been trying to run rake but it seems that ever since I
I have a php file that needs to be run on a cronjob and
How would I have a top right corner div as shown in the image.
How can I have just the top corners rounded for a WPF rectangle? I
So I have a page like this you look at. On top I have
Good afternoon, I have a quick 'top level' question regarding the usage of Facebook

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.