python2.3 upgrade

Lee Harr missive at frontiernet.net
Sat Dec 13 19:32:46 EST 2003


On 2003-12-13, tudor <tudor.tatar at tin.it> wrote:
> Lawrence Oluyede wrote:
>
>> tudor <tudor.tata at tin.it> writes:
>> 
>>> Traceback (most recent call last):
>>>    File "/usr/sbin/redhat-switch-printer", line 84, in ?
>>>      main()
>>>    File "/usr/sbin/redhat-switch-printer", line 68, in main
>>>      from switchprinter_gui import mainDialog
>>>    File "/usr/share/redhat-switch-printer/switchprinter_gui.py", line 51,
>>>    in ?
>>>      import gtk
>>> ImportError: No module named gtk
>> 
>> Have you reinstalled pygtk for the right python version?
>> 
> I have pygtk-1.99 which I guess is too old....
> But I don't think I'm gonna find rpms for my rh8 of the new pygtk, so I'll
> have to renew the whole gtk2 ! which kinda sounds scarry to me...


I see 2 possibilities.

Often, when "upgrading" python, what you really do is just install a new
version, and the old version is still there.

Try something like ... 

ls -l /usr/local/bin/py*

and see if you get ...

-r-xr-xr-x  2 root  wheel  766652 Nov 21 03:53 /usr/local/bin/python
-r-xr-xr-x  1 root  wheel  520908 Oct 14 20:03 /usr/local/bin/python2.1
-r-xr-xr-x  1 root  wheel  657928 Sep 26 13:20 /usr/local/bin/python2.2
-r-xr-xr-x  2 root  wheel  766652 Nov 21 03:53 /usr/local/bin/python2.3

(you may have to look around for where your python is)

If 2.2 is still there, but python is pointing to python2.3 you should
be able to get the old version working again by doing

rm /usr/local/bin/python
ln /usr/local/bin/python2.2 /usr/local/bin/python

Then when you want to run 2.3 for your own use, or for programs that
require 2.3 you will have to run it specifically as python2.3


The other option would be to just copy the packages from the old install
to the new one. Something along the lines of ...

cp -R /usr/local/lib/python2.2/site-packages/* /usr/local/lib/python2.3/site-packages


You will probably get warnings when programs start up, but it should work
at least until you get a chance to rebuild things.





More information about the Python-list mailing list