Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 133438 - pygtk fails from /usr/bin (affects pitivi, istanbul, simple test case)
Summary: pygtk fails from /usr/bin (affects pitivi, istanbul, simple test case)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords:
: 142118 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-05-15 20:33 UTC by Colin Macdonald
Modified: 2006-08-23 00:28 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
test.log (test.log,4.46 KB, text/plain)
2006-08-20 12:31 UTC, Colin Macdonald
Details
localtest.log (localtest.log,6.40 KB, text/plain)
2006-08-20 12:32 UTC, Colin Macdonald
Details
pytests.diff (pytests.diff,3.40 KB, text/plain)
2006-08-20 12:33 UTC, Colin Macdonald
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Colin Macdonald 2006-05-15 20:33:22 UTC
When I start pitivi I immediately get an error:
PyGTK couldn't be found !

I ran python manually and tried stepping through the offending code inside the try block:
def _init_gobject_gtk_gst():
    try:
        import pygtk
        pygtk.require("2.0")

        import gtk

        import gobject
        gobject.threads_init()
    except ImportError:
        raise SystemExit("PyGTK couldn't be found !")
but I don't get any errors.

The other strange thing is that pitivi works on my laptop (which has a very similar setup: same python, same pygtk).

emerge --info:
Portage 2.1_rc1-r2 (default-linux/x86/2005.0, gcc-4.1.0, glibc-2.4-r2, 2.6.16.9 i686)
=================================================================
System uname: 2.6.16.9 i686 AMD Athlon(tm) Processor
Gentoo Base System version 1.12.0_pre19
distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [enabled]
dev-lang/python:     2.4.3-r1
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     [Not Present]
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2
sys-devel/binutils:  2.16.1-r2
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r5
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=i686 -O3 -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/kde/3/share/config /usr/lib/globus-2.4/etc /usr/lib/mozilla/defaults/pref /usr/share/X11/xkb /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/eselect/compiler /etc/gconf /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c /etc/env.d"
CXXFLAGS="-march=i686 -O3 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig collision-protection distcc distlocks metadata-transfer sandbox sfperms strict userpriv usersandbox"
GENTOO_MIRRORS="http://gentoo.mirrors.easynews.com/linux/gentoo/ http://gentoo.chem.wisc.edu/gentoo/ ftp://gentoo.mirrors.tds.net/gentoo ftp://194.117.143.71/mirrors/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage /usr/local/ag-portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 3dnow X Xaw3d a52 aac aalib acpi alsa apache2 apm arts audiofile avahi avi berkdb bitmap-fonts bzip2 cairo cdr cjk cli crypt cups curl dbus dga dri dts dv dvb dvd dvdr eds emacs emboss encode esd exif expat f77 faad fbcon ffmpeg fftw flac fortran gcj gd gdbm gif gimpprint ginac gmp gnome gnustep gnutls gphoto2 gpm gstreamer gtk gtk2 gtkhtml hal idn imagemagick imlib isdnlog jack java jpeg lcms leim libcaca libg++ libwww lirc live mad matroska mikmod mmx mng mono motif mozilla mp3 mpeg mysql nas ncurses nls nptl offensive ogg oggvorbis openal opengl oss pam pcre pdf pdflib perl plotutils png ppds pppd python qhull qt quicktime radeon readline reflection rtc samba scanner sdk sdl session slang speex spell spl sqlite sse ssl svg tcltk tcpd tetex theora threads tiff truetype truetype-fonts type1-fonts unicode usb v4l v4l2 vcd vorbis wmf wxwindows xinerama xml xml2 xmms xorg xosd xprint xv xvid zlib elibc_glibc input_devices_evdev input_devices_keyboard input_devices_mouse kernel_linux userland_GNU video_cards_i810 video_cards_radeon video_cards_mach64 video_cards_vesa video_cards_vga video_cards_fbdev video_cards_v4l"
Unset:  ASFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Colin Macdonald 2006-06-26 16:40:56 UTC
Links:

http://sourceforge.net/mailarchive/forum.php?thread_id=8925803&forum_id=38645
http://sourceforge.net/forum/forum.php?thread_id=1312868&forum_id=348707

Seem to claim it was solved in CVS in 2005-11...

Another user has contacted me who also has this problem.  Any suggestions for how to debug it?
Comment 2 Colin Macdonald 2006-07-29 13:21:45 UTC
I've filed bug #142118 where something similar is happening with istanbul.  It might be a dup of this bug.
Comment 3 Colin Macdonald 2006-07-29 13:27:23 UTC
Discouvered something new: if I copy /usr/bin/pitivi to my user's home dir and run that copy instead than pitivi works!  Seems like some kind of path/env problem...

Workaround:
$ cd ~
$ cp /usr/bin/pitivi ./pitivi
$ ./pitivi

On further inspection, copying /usr/bin/pitivi to /usr/local/bin/mypitivi also seems to fix it...

Also, istanbul (bug 142118) also works when copied to /usr/local/bin
I think this confirms the dup.
Comment 4 Colin Macdonald 2006-07-29 13:27:41 UTC
*** Bug 142118 has been marked as a duplicate of this bug. ***
Comment 5 Colin Macdonald 2006-07-29 13:31:43 UTC
I have this sneaking suspicion that this bug has something to do with the multitude of useless symlinks that portage (i think) created on my system sometime in 2005 (symlinks of the form /usr/lib/foo/foo-> //usr/lib/foo).  I've made an attempt and removing them all but this bug persists: I will try rebuilding python and pygtk now that I've cleaned up most (all?) of those weird symlinks.
Comment 6 Colin Macdonald 2006-07-29 14:22:26 UTC
Still doesn't work with rebuilt python, pygtk, pitvi and istanbul.

More info: a symlink from /usr/local/bin/mypitivi to /usr/bin/piviti doesn't work but copying or making a hard link does work.

Test case:
#!/usr/bin/env python
import pygtk
pygtk.require("2.0")
import gtk

When run from /usr/local/bin, this script is successful but when run from /usr/bin it results in:
Traceback (most recent call last):
  File "/usr/bin/testpy2", line 4, in ?
    import gtk
ImportError: No module named gtk

Maybe that will help someone suggest whats wrong here?
Comment 7 Hanno Böck gentoo-dev 2006-08-08 06:44:41 UTC
Is this still an issue with 0.10.1??
Comment 8 Hanno Böck gentoo-dev 2006-08-08 16:19:49 UTC
Closing for now, please re-open if it still occurs.
Comment 9 Colin Macdonald 2006-08-08 18:51:20 UTC
Reopening, changing summary...  this bug probably has nothing to do with pitivi.  As I mentioned in comment #6, this simple test case fails when placed in /usr/bin but works elsewhere:

#!/usr/bin/env python
import pygtk
pygtk.require("2.0")
import gtk

Maybe you can reassign this to the python folks? (bugzilla won't let me)
Comment 10 Colin Macdonald 2006-08-08 18:55:21 UTC
Sorry, forgot to mention that of course I did test with the new pitivi but still fails.

Also I should point out I'm in a pretty good situation to help debug this as I have two very similar systems but only one suffers from this bug.
Comment 11 Hanno Böck gentoo-dev 2006-08-19 08:25:31 UTC
As this seems to be a general pygtk-problem, re-assigning to the corresponding herd.
Comment 12 Alastair Tse (RETIRED) gentoo-dev 2006-08-20 02:55:14 UTC
Works for me. You're the only person who is reportedly seeing this bug so I suspect it is a local problem. Please list all the versions of pygtk you have installed and your emerge info as well.
Comment 13 Colin Macdonald 2006-08-20 11:14:06 UTC
I'm absoluetly sure its a local problem: as I mentioned above, it doesn't manifest itself on my laptop which has a similar setup.  I would appreciate any suggests for how to debug it!

At least one other person is affected, zhangf1979[at]hotmail.com (on the CC list) contacted me offlist (offbug?) back when we thought this was a PiTiVi problem.

# equery list pygtk
[ Searching for package 'pygtk' in all categories among: ]
 * installed packages
[I--] [  ] dev-python/pygtk-2.8.6 (2)

# emerge --info
Portage 2.1.1_pre5-r1 (default-linux/x86/2006.0, gcc-4.1.1/vanilla, glibc-2.4-r3, 2.6.17.8 i686)
=================================================================
System uname: 2.6.17.8 i686 AMD Athlon(tm) Processor
Gentoo Base System version 1.12.4
Last Sync: Thu, 17 Aug 2006 22:30:01 +0000
distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [enabled]
app-admin/eselect-compiler: 2.0.0_rc2-r1
dev-lang/python:     2.4.3-r1
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     [Not Present]
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.18.1
sys-devel/autoconf:  2.13, 2.60
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2
sys-devel/binutils:  2.17
sys-devel/gcc-config: 2.0.0_rc1
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.17
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=i686 -O2 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/lib/globus-2.4/etc /usr/lib/mozilla/defaults/pref /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/eselect/compiler /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c"
CXXFLAGS="-march=i686 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig collision-protection distcc distlocks metadata-transfer sandbox sfperms strict userpriv usersandbox"
GENTOO_MIRRORS="http://gentoo.mirrors.easynews.com/linux/gentoo/ http://gentoo.chem.wisc.edu/gentoo/ ftp://gentoo.mirrors.tds.net/gentoo ftp://194.117.143.71/mirrors/gentoo"
LINGUAS=""
MAKEOPTS="-j1"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage /usr/local/ag-portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 3dnow X Xaw3d a52 aac aalib acpi alsa apache2 apm arts audiofile avahi avi berkdb bitmap-fonts bzip2 cairo cdr cjk cli crypt cups curl dbus dga dlloader dri dts dv dvb dvd dvdr eds elibc_glibc emacs emboss encode esd exif expat f77 faad fbcon ffmpeg fftw flac fortran gcj gd gdbm gif gimpprint ginac glut gmp gnome gnustep gnutls gphoto2 gpm gstreamer gtk gtk2 gtkhtml hal idn imagemagick imlib input_devices_evdev input_devices_keyboard input_devices_mouse isdnlog jack java jpeg kernel_linux lcms leim libcaca libg++ libwww lirc lirc_devices_realmagic live mad matroska mikmod mmx mng mono motif mozilla mp3 mpeg mysql nas ncurses nls nptl offensive ogg openal opengl oss pam pcre pdf pdflib perl plotutils png ppds pppd python qhull qt3 quicktime radeon readline reflection rtc samba scanner sdk sdl session slang speex spell spl sqlite sse ssl svg tcl tcltk tcpd tetex theora threads tiff tk truetype truetype-fonts type1-fonts udev unicode usb userland_GNU v4l v4l2 vcd video_cards_fbdev video_cards_i810 video_cards_mach64 video_cards_radeon video_cards_v4l video_cards_vesa video_cards_vga vorbis wmf wxwindows xinerama xml xmms xorg xosd xprint xv xvid zlib"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, PORTAGE_RSYNC_EXTRA_OPTS

Comment 14 Alastair Tse (RETIRED) gentoo-dev 2006-08-20 12:06:00 UTC
ok, are there any *.py files in /usr/bin? another thing that will help is try setting PYTHONVERBOSE=1 in your environment when you try to run it from /usr/bin:

eg:

PYTHONVERBOSE=1 /usr/bin/test.py

and tell us what you see
Comment 15 Colin Macdonald 2006-08-20 12:30:35 UTC
cbm@aconite /usr/bin $ ls -al *.py
-rwxr-xr-x 1 root root  4573 Feb 20 22:53 AGServiceManager.py
-rwxr-xr-x 1 root root 25866 Feb 20 22:53 BridgeServer.py
-rwxr-xr-x 1 root root  1363 Feb 20 22:53 CertificateManager.py
-rwxr-xr-x 1 root root  1497 Feb 20 22:53 CertificateRequestTool.py
-rwxr-xr-x 1 root root  3331 Feb 20 22:53 GoToVenue.py
-rwxr-xr-x 1 root root  2133 Feb 20 22:53 NodeManagement.py
-rwxr-xr-x 1 root root 45996 Feb 20 22:53 NodeSetupWizard.py
-rwxr-xr-x 1 root root  3428 Feb 20 22:53 VenueClient.py
-rwxr-xr-x 1 root root 98286 Feb 20 22:53 VenueManagement.py
-rwxr-xr-x 1 root root  3890 Feb 20 22:53 VenueServer.py
-rwxr-xr-x 1 root root 15768 Feb 20 22:53 agpm.py
-rwxr-xr-x 1 root root 23372 Feb 20 22:53 certmgr.py
-rwxr-xr-x 1 root root  5314 Jul  2 20:43 games-server.py
-rwxr-xr-x 1 root root 65081 Jul 25 15:22 mpd.py
-rwxr-xr-x 1 root root  1980 Jul 25 15:22 mpdallexit.py
-rwxr-xr-x 1 root root 15723 Jul 25 15:22 mpdboot.py
-rwxr-xr-x 1 root root 21885 Jul 25 15:22 mpdcheck.py
-rwxr-xr-x 1 root root  1466 Jul 25 15:22 mpdchkpyver.py
-rwxr-xr-x 1 root root  2388 Jul 25 15:22 mpdcleanup.py
-rwxr-xr-x 1 root root  2724 Jul 25 15:22 mpdexit.py
-rwxr-xr-x 1 root root  6892 Jul 25 15:22 mpdgdbdrv.py
-rwxr-xr-x 1 root root  1129 Jul 25 15:22 mpdhelp.py
-rwxr-xr-x 1 root root  2996 Jul 25 15:22 mpdkilljob.py
-rwxr-xr-x 1 root root 50061 Jul 25 15:22 mpdlib.py
-rwxr-xr-x 1 root root  6360 Jul 25 15:22 mpdlistjobs.py
-rwxr-xr-x 1 root root 75753 Jul 25 15:22 mpdman.py
-rwxr-xr-x 1 root root  2586 Jul 25 15:22 mpdringtest.py
lrwxrwxrwx 1 root root    10 Jul 25 15:22 mpdrun.py -> mpiexec.py
-rwxr-xr-x 1 root root  4639 Jul 25 15:22 mpdsigjob.py
-rwxr-xr-x 1 root root  2861 Jul 25 15:22 mpdtrace.py
-rwxr-xr-x 1 root root 56778 Jul 25 15:22 mpiexec.py
lrwxrwxrwx 1 root root    10 Jul 25 15:22 mpirun.py -> mpiexec.py
-rwxr-xr-x 1 root root  2313 Sep 22  2005 pilconvert.py
-rwxr-xr-x 1 root root 15344 Sep 22  2005 pildriver.py
-rwxr-xr-x 1 root root  2546 Sep 22  2005 pilfile.py
-rwxr-xr-x 1 root root  1007 Sep 22  2005 pilfont.py
-rwxr-xr-x 1 root root  2337 Sep 22  2005 pilprint.py
-rwxr-xr-x 1 root root 18011 Aug  5 23:33 smtpd.py
-rwxr-xr-x 1 root root    68 Aug 20 12:23 test.py

nothing to suspicious there...  attachments to follow
Comment 16 Colin Macdonald 2006-08-20 12:31:26 UTC
Created attachment 94717 [details]
test.log

PYTHONVERBOSE=1 /usr/bin/test.py output
Comment 17 Colin Macdonald 2006-08-20 12:32:03 UTC
Created attachment 94719 [details]
localtest.log

PYTHONVERBOSE=1 /usr/local/bin/localtest.py
Comment 18 Colin Macdonald 2006-08-20 12:33:54 UTC
Created attachment 94721 [details]
pytests.diff

the differences between them.  Note there are no differences up until the error.
Comment 19 Alastair Tse (RETIRED) gentoo-dev 2006-08-21 15:45:17 UTC
the pygtk.py script is failing to detect the version of gtk that you have or is finding it in a place that it doesn't expect.

it seems to imply that there might be something called /usr/bin/gtk-2.0/ like that. can you check if there is something that returns if :

ls -l /usr/bin/gtk-[0-9].[0-9]

Comment 20 Colin Macdonald 2006-08-23 00:28:32 UTC
Indeed you are correct:

cbm@aconite /usr/bin $ ls -al gtk*
lrwxrwxrwx 1 root root      13 Mar 22  2005 gtk -> /usr/lib//gtk
lrwxrwxrwx 1 root root      17 Mar 22  2005 gtk-2.0 -> /usr/lib//gtk-2.0
-rwxr-xr-x 1 root root    2087 Sep 16  2004 gtk-config
-rwxr-xr-x 1 root root  119048 Jul 31 20:03 gtk-demo
-r-xr-xr-x 1 root root 2627028 Apr 24 12:43 gtk-gnutella
-rwxr-xr-x 1 root root   17260 May 11  2005 gtk-ocr
-rwxr-xr-x 1 root root    7348 Jul 31 20:03 gtk-query-immodules-2.0
-rwxr-xr-x 1 root root   16268 Jul 31 20:03 gtk-update-icon-cache
lrwxrwxrwx 1 root root      17 Mar 22  2005 gtkhtml -> /usr/lib//gtkhtml
lrwxrwxrwx 1 root root      19 Mar 22  2005 gtkmm-2.4 -> /usr/lib//gtkmm-2.4

its more of those foo -> /usr/lib//foo symlinks that appeared in 2005 (see comment #5---guess I'll have to rethink my script that was supposed to find them all).  I cleaned those out and now pitivi (and my simple test case) work fine.

Thanks so much!