Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > python Noob - basic setup question / problem

Reply
Thread Tools

python Noob - basic setup question / problem

 
 
Lilavivat
Guest
Posts: n/a
 
      12-04-2006
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
 
Reply With Quote
 
 
 
 
Christophe
Guest
Posts: n/a
 
      12-04-2006
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
 
Reply With Quote
 
 
 
 
Bjoern Schliessmann
Guest
Posts: n/a
 
      12-04-2006
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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Here a noob, there a noob.... JimDoire MCSE 0 04-10-2008 07:23 PM
dhcp cisco806 basic setup question/problem... Captain Cisco 4 07-26-2006 10:09 PM
Some basic questions from a noob. Josh MCSA 6 06-20-2005 03:45 PM
Re: Python interpreter in Basic or a Python-2-Basic translator. rrr@ronadam.com Python 0 05-02-2005 01:48 PM
Python interpreter in Basic or a Python-2-Basic translator. Engineer Python 6 05-01-2005 10:16 PM



Advertisments