#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2013
    Posts
    9
    Rep Power
    0

    My Shebang in Debian Weezy for RPi does not work


    Hi,
    I am trying to make some executable for my Python scripts by adding the shebang as first topmost line of my scripts by adding
    #!/usr/bin/python
    or
    #!/usr/bin/env python

    but neither of these are working. I am using Debian wheezy distribution for Rpi. and regard less I use Python or Python3 the results are the same !!!
    But If I use my IDLE or IDLE3 environment and run or If from a terminal I write:

    $ sudo python myapp.py

    it works as it should.
    I would appreciate if some one could shade some light on this and get me going.

    Br and thanks in advance
    Amir
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Location
    /dev/null
    Posts
    164
    Rep Power
    19
    Can you try this on your shell:
    Code:
    $ which python
    If it returns, say, "/home/python27/python", then you should set your shebang to this path.
  4. #3
  5. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,997
    Rep Power
    481
    You need to enable executable mode.


    $ chmod +x your.script
    [code]Code tags[/code] are essential for python code and Makefiles!

IMN logo majestic logo threadwatch logo seochat tools logo