PDA

View Full Version : Python association problems? Please help


Munk
10-31-2008, 12:40 AM
Hello everyone. I use to be able to type the name of a Python program that I wanted to run at a xterminal and it worked like this:
somepythonprogram.py

Now after doing an upgrade I have to preface it with "python2.5" to get it to run, such as:
python2.5 somepythonprogram.py

Plus, many of the Python programs that once worked no longer launch such as DialCentral and the newly installed mClock.

I've uninstalled Python-2.5 and re-installed it a million times. I've done "apt-get python...." a million times. I've installed Python launcher in hopes that something would get fixed but to no avail. I've also read and tried different things for hours on end and nothing seems to be fixing it.

yerga
10-31-2008, 06:34 AM
Hello everyone. I use to be able to type the name of a Python program that I wanted to run at a xterminal and it worked like this:
somepythonprogram.py

Now after doing an upgrade I have to preface it with "python2.5" to get it to run, such as:
python2.5 somepythonprogram.py

Plus, many of the Python programs that once worked no longer launch such as DialCentral and the newly installed mClock.

I've uninstalled Python-2.5 and re-installed it a million times. I've done "apt-get python...." a million times. I've installed Python launcher in hopes that something would get fixed but to no avail. I've also read and tried different things for hours on end and nothing seems to be fixing it.

What's the output running "python"?

What's the output if you run "python /usr/bin/mClock"?

From the terminal, I mean.

Also, it would be useful if you upload the file created with:
"dpkg -l python* > /media/mmc2/installed_python_packages.txt"

Munk
11-02-2008, 11:32 PM
Oh man, thanks yerga for helping. Here are the results you asked for.

What's the output running "python"?

If I type just "python" I get the message of:
/bin/sh: not found


What's the output if you run "python /usr/bin/mClock"?

If I type that I get the same exact error message:
/bin/sh: not found

As a test, I have also tried typing:
python2.5 /usr/bin/mClock

And I get this error message:
File "/usr/bin/mClock", line 2
exec python -O /usr/lib/mClock/mClock.py $
^

Also, it would be useful if you upload the file created with:
"dpkg -l python* > /media/mmc2/installed_python_packages.txt"

Ok, I've created the file, transferred it to my WinXP comp and uploaded it here. Hopefully the carriage return formatting doesn't cause any problems.

hvacengi
11-03-2008, 08:40 AM
Did you have python launcher installed and then uninstall it?

I had this same issue a week or so ago, and it looks like when I uninstalled python launcher it didn't repair the link for "/usr/bin/python"

If you run the command
cd /usr/bin
ls -l python
it will give you the target of the existing python link. it should point to "/usr/bin/python2.5", or "./python2.5" (the former being preferred)

If it shows a different target, you'll need to run the following command as root to get it working:
rm python
ln -s /usr/bin/python2.5 python

I hope this helps fix the issues you're seeing!

Munk
11-04-2008, 07:16 PM
hvacengi,

YES, YES, YES... That did it. Awesome. I'd hit 'thanks' ten times but that would just leave you with no thanks.

Thank you both for your awesome help.

hvacengi
11-05-2008, 09:01 AM
Ha ha, I'm glad I could help out!