python Noob - basic setup question / problem

Discussion in 'Python' started by Lilavivat, Dec 4, 2006.

  1. Lilavivat

    Lilavivat Guest

    Running SUSE 10.1 on an AMD64. When I try and run a python program I get
    the following error:

    /usr/bin/python2: bad interpreter: No such file or directory

    "which python" gives me "/usr/local/bin/python"

    "which python2.4" gives me "/usr/local/bin/python2.4"

    But /usr/bin/python is symlinked to python2.4 "python -> python2.4"

    "which python2" and nothing comes up.

    Basically I have no idea what's going on... help please!

    Thanks,
    SETH
     
    Lilavivat, Dec 4, 2006
    #1
    1. Advertising

  2. Lilavivat

    Christophe Guest

    Lilavivat a écrit :
    > Running SUSE 10.1 on an AMD64. When I try and run a python program I get
    > the following error:
    >
    > /usr/bin/python2: bad interpreter: No such file or directory
    >
    > "which python" gives me "/usr/local/bin/python"
    >
    > "which python2.4" gives me "/usr/local/bin/python2.4"
    >
    > But /usr/bin/python is symlinked to python2.4 "python -> python2.4"
    >
    > "which python2" and nothing comes up.
    >
    > Basically I have no idea what's going on... help please!
    >
    > Thanks,
    > SETH

    Fault of the Python program : it hardcodes that the Python interpreter
    is /usr/bin/python2

    Check the first line of the executable ( I bet it is a simple text file
    so go away and edit it with emacs/vim/joe/ed ... ). It should be ( with
    maybe a few spaces here and there ) :
    #!/usr/bin/python2

    replace it with :
    #!/usr/bin/python
     
    Christophe, Dec 4, 2006
    #2
    1. Advertising

  3. Lilavivat wrote:

    > /usr/bin/python2: bad interpreter: No such file or directory
    >
    > "which python" gives me "/usr/local/bin/python"
    >
    > "which python2.4" gives me "/usr/local/bin/python2.4"
    >
    > But /usr/bin/python is symlinked to python2.4 "python ->
    > python2.4"


    Try to understand what "which" does. It says which file it calls if
    you input the parameter into the shell. So if this happens

    $ which python
    /usr/local/bin/python

    there's no point looking at /usr/bin/python.

    What does "ls -l /usr/local/bin/python" say? I bet it's a dangling
    symlink.

    Regards,


    Björn

    --
    BOFH excuse #255:

    Standing room only on the bus.
     
    Bjoern Schliessmann, Dec 4, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Engineer
    Replies:
    6
    Views:
    665
    Jeremy Bowers
    May 1, 2005
  2. Replies:
    0
    Views:
    470
  3. Chris Shenton
    Replies:
    1
    Views:
    1,485
    =?ISO-8859-1?Q?Michael_Str=F6der?=
    Aug 24, 2007
  4. John Maclean
    Replies:
    12
    Views:
    263
    Robert Klemme
    Jan 21, 2006
  5. Robbie Brown

    Basic noob question re console input

    Robbie Brown, Feb 12, 2014, in forum: C Programming
    Replies:
    26
    Views:
    228
    Jorgen Grahn
    Feb 15, 2014
Loading...

Share This Page