Ticket #1718 (closed defect: fixed)
python-pygtk programs don't work
| Reported by: | Mercury | Owned by: | julian_chu |
|---|---|---|---|
| Priority: | normal | Milestone: | Om2008.8 |
| Component: | Distro | Version: | GTA02v5 |
| Severity: | normal | Keywords: | |
| Cc: | noha | Blocked By: | |
| Blocking: | Estimated Completion (week): | ||
| HasPatchForReview: | PatchReviewResult: | ||
| Reproducible: |
Description
I tried installing python-pygtk to run a script someone had written, but it (and all other pygtk scripts) fail out with this error:
Traceback (most recent call last):
File "./pygtkconsole.py", line 14, in <module>
import gtk
File "/usr/lib/python2.5/site-packages/gtk-2.0/gtk/init.py", line 82, in <module>
init()
NameError?: name 'init' is not defined
The error seems to be indicating that the problem is during the initialization of the gtk stuff.
I'm using the 'http://downloads.openmoko.org/openmoko-repository/ASU/' feed and I ran opkg upgrade today and it didn't help.
Change History
comment:2 Changed 5 years ago by Yasumoto
- Owner changed from julian_chu to openmoko-devel
- Version changed from unspecified to GTA02v5
- Component changed from Distro to unknown
I can confirm this issue using the 2008.08 build released today.
comment:3 Changed 5 years ago by Yasumoto
- Owner changed from openmoko-devel to julian_chu
- Component changed from unknown to Distro
comment:4 Changed 5 years ago by neilbrown
I had this problem too.
I found that if you change the "init" call on line 82 of
/usr/lib/python2.5/site-packages/gtk-2.0/gtk/_init_.py
to "_init" (i.e. add a leading underscore),
then pygtk works perfectly.
comment:5 follow-up: ↓ 6 Changed 5 years ago by erin
i had same problem too and i modified '/usr/lib/python2.5/site-packages/gtk-2.0/gtk/_init_.py' this file like NeilBrown? replied.
comment:6 in reply to: ↑ 5 Changed 5 years ago by h.koenig
Replying to erin:
i had same problem too and i modified '/usr/lib/python2.5/site-packages/gtk-2.0/gtk/_init_.py' this file like NeilBrown? replied.
same problem here (needed for battery.ipk) -- found same "fix" after spending some time
(and after knowing the problem/fix I also found this ticket;)
what about releasing a new and fixed python-pygtk package to help others ?!
comment:7 Changed 5 years ago by erin_yueh
yeah, you can get the latest released opkg here.
root@om-gta02:~# opkg install python-pygtk
Installing python-pygtk (2.10.4-ml8) to root...
Downloading http://downloads.openmoko.org/repository/testing/armv4t/python-pygtk_2.10.4-ml8_armv4t.ipk
comment:9 Changed 5 years ago by regina_kim
hey Mercury~ please check this issue weather still happen or not.
comment:10 Changed 5 years ago by Mercury
It works now :)
comment:11 Changed 5 years ago by erin_yueh
- Status changed from in_testing to closed
- Resolution set to fixed
comment:12 Changed 5 years ago by dolfje
Is this supposed to be solved in the stable updates of om2008.8? Because I still have this problem. I did a forced reinstall of python-pygtk and get again a init.py file with on line 82 init() instead of _init()
comment:13 Changed 5 years ago by rhk
Installed 2008.9 yesterday and had this. Fixed manually editing the line 82 of init.py
Is the fix included in the main repositories now?
comment:14 Changed 5 years ago by exactt
what is the actual reason that a fix released and tested 6(!) weeks ago hasn't made it into the official 2008.8/9 repos yet?
