I’m running an application on my OpenSuse 11.1 system called Gramps, which tracks genealogy (family history). During one of the typical updates about a month ago, the app stopped working - just hung when I would try to run it. When I would run it from the terminal, I would receive the following error:
Gramps is written in Python, so following the information in the Gramps Wiki about debugging, I used the following python command to troubleshoot a little further - ‘python -m trace -t gramps.py’. I get a long display of debug info that ends with the following lines:
File “/usr/local/lib/python2.5/trace.py”, line 794, in <module>
main()
File “/usr/local/lib/python2.5/trace.py”, line 782, in main
t.run(‘execfile(%r)’ % (progname,))
File “/usr/local/lib/python2.5/trace.py”, line 489, in run
exec cmd in dict, dict
File “<string>”, line 1, in <module>
File “gramps.py”, line 187, in <module>
errors = run()
File “gramps.py”, line 179, in run
from gui.grampsgui import startgtkloop
File “gui/grampsgui.py”, line 53, in <module>
import gtk
ImportError: No module named gtk
I’ve re-installed every package with ‘gtk’ in the title that was already installed, and even re-installed python 2.5.4 to no avail.
Any other thoughts on how I might resolve this? Thanks!
> I’ve re-installed every package with ‘gtk’ in the title that was
> already installed, and even re-installed python 2.5.4 to no avail.
>
> Any other thoughts on how I might resolve this? Thanks!
>
Not really another thought but can you check explicitly that python-gtk is
installed with
rpm -q python-gtk
and if not install or reinstall it?
Also run python and check with
import gtk
that it works or not (maybe it is a issue of your special program not a
python-gtk issue).
–
openSUSE 11.3 64 bit | Intel Core2 Quad Q8300@2.50GHz | KDE 4.5 | GeForce
9600 GT | 4GB Ram
openSUSE 11.3 64 bit | Intel Core2 Duo T9300@2.50GHz | KDE 4.5 | Quadro FX
3600M | 4GB Ram
> bvalaski wrote:
>
>> I’ve re-installed every package with ‘gtk’ in the title that was
>> already installed, and even re-installed python 2.5.4 to no avail.
>>
It seems the default python on 11.1 is now 2.6 not 2.5 (I just checked the
11.1 standard repo) probably that is the reason your python 2.5 does not see
any module.
–
openSUSE 11.3 64 bit | Intel Core2 Quad Q8300@2.50GHz | KDE 4.5 | GeForce
9600 GT | 4GB Ram
openSUSE 11.3 64 bit | Intel Core2 Duo T9300@2.50GHz | KDE 4.5 | Quadro FX
3600M | 4GB Ram
It looks like from the trace, you are using a custom python library in /usr/local/lib/python2.5. Are you aware of it and is there a reason for that? Custom libraries can clash with official ones.
Gtk module if I’m not much mistaken is located in /usr/lib/python/site-packages/gtk-2.0
If you have no such folder or it is empty try to reinstall the packet python-gtk.
PS: Whoops! I’m too late!
Martin, thanks for the suggestions. The output from ‘rpm -q python-gtk’ is: python-gtk-2.12.1-63.3.
I searched for the module from Rpmfind.Net and located python-gtk-2.12.1-63.3.i586.rpm corresponding to OpenSuse 11.1. When I tried to reinstall the RPM using ‘zypper in’ I get the following message:
Loading repository data…
Reading installed packages…
‘python-gtk’ providing ‘python-gtk=2.12.1-63.3’ is already installed.
Resolving package dependencies…
Nothing to do.
…hard to argue with that kind of logic, right <g>?
Yeah, according to Yast I’ve got installed Python 2.60-2.23.1.
When I was first trying to troublshoot this issue I ran across a note (through a Google search) that multiple versions of Python could be installed to resolve version-specific dependency issues. I downloaded and installed Python 2.54 to see if it resolved my problem and it didn’t. Is there an environment variable I could set to make 2.6 the default python version to use? Thanks.
>
> Yeah, according to Yast I’ve got installed Python 2.60-2.23.1.
>
> When I was first trying to troublshoot this issue I ran across a note
> (through a Google search) that multiple versions of Python could be
> installed to resolve version-specific dependency issues. I downloaded
> and installed Python 2.54 to see if it resolved my problem and it
> didn’t. Is there an environment variable I could set to make 2.6 the
> default python version to use? Thanks.
>
Sorry just came back from a travel. It is late here I will come back on that
tomorrow.
In principle you can have severaol python versions but have to be carefull
because they cannot see each others packages.
I recommend you uninstall the 2.5.4 if you do not need it to get a cleaned
system.
After that type
python --version
to ensure you use 2.6 as your default version.
–
openSUSE 11.3 64 bit | Intel Core2 Quad Q8300@2.50GHz | KDE 4.5 | GeForce
9600 GT | 4GB Ram
openSUSE 11.3 64 bit | Intel Core2 Duo T9300@2.50GHz | KDE 4.5 | Quadro FX
3600M | 4GB Ram
Looking through the Python docs, I didn’t run across anything (under Linux) like a simple uninstaller. In YAST, I see the 2.6 version of Python listed, but not the 2.5.4. Digging deeper, 2.5.4 is installed into /usr/local/lib/python25. Unless you recommend otherwise, I’ll simply delete that directory, then restart my system. After that I’ll see if ‘python --version’ indicates that the 2.6 version is back in control. Make sense? Thanks.
>
> Looking through the Python docs, I didn’t run across anything (under
> Linux) like a simple uninstaller. In YAST, I see the 2.6 version of
> Python listed, but not the 2.5.4. Digging deeper, 2.5.4 is installed
> into /usr/local/lib/python25. Unless you recommend otherwise, I’ll
> simply delete that directory, then restart my system. After that I’ll
> see if ‘python --version’ indicates that the 2.6 version is back in
> control. Make sense? Thanks.
>
> Bill
>
Most probably you also have a python command in /usr/local/bin which you
also need to delet in addition to the /usr/local/lib/python25.
Then it should be removed.
–
openSUSE 11.3 64 bit | Intel Core2 Quad Q8300@2.50GHz | KDE 4.5 | GeForce
9600 GT | 4GB Ram
openSUSE 11.3 64 bit | Intel Core2 Duo T9300@2.50GHz | KDE 4.5 | Quadro FX
3600M | 4GB Ram
Martin, sorry about the slow response - finally got out a project that had me busy all weekend.
I removed the pyton25 directory and the python file under /usr/local/bin. When I enter ‘python --version’ at the terminal, I’m informed that 2.5.4 is running, not 2.6 as shown in Yast. Any other location I should remove or check for the older copy of python? Thanks.
OK, that’s simple enough - I get in sreponse:
/usr/local/bin/python
When I ‘ld’ the folder, there are several python shortcuts, the python application, and a couple other files. Delete all the python-related files and see what happens? Thanks.
Alright, last post finally! Deleted the python files under /user/bin/python and restarted OpenSuse. Python 2.6 is finally back in control. When I perform ‘whereis python’ I get the following directories:
Well done. You have to be careful when you install extra software on the side. Even I have been tripped up by wrong versions of executables or libraries in /usr/local.