Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 90417 - equery error: "ImportError: No module named gentoolkit"
Summary: equery error: "ImportError: No module named gentoolkit"
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High blocker (vote)
Assignee: Portage Tools Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-25 12:24 UTC by Stahl Sau
Modified: 2005-04-30 20:04 UTC (History)
3 users (show)

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


Attachments
Patch for Makefile in gentoolkit-0.2.1_pre1/src/gentookit (Makefile.patch,1.04 KB, patch)
2005-04-25 14:33 UTC, Paul Varner (RETIRED)
Details | Diff
Missing errors.py file from local copy of gentoolkit CVS (errors.py,388 bytes, text/plain)
2005-04-25 20:37 UTC, Paul Varner (RETIRED)
Details
Patch to fix equery (gentoolkit.patch,1.83 KB, patch)
2005-04-25 20:43 UTC, Paul Varner (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stahl Sau 2005-04-25 12:24:53 UTC
Hi,
starting equery with or without options crashes instantly and prints out:
xxx:~>equery
Traceback (most recent call last):
  File "/usr/bin/equery", line 27, in ?
    import gentoolkit
ImportError: No module named gentoolkit



Reproducible: Always
Steps to Reproduce:
1.equery [enter]
2.
3.

Actual Results:  
xxx:~>equery
Traceback (most recent call last):
  File "/usr/bin/equery", line 27, in ?
    import gentoolkit
ImportError: No module named gentoolkit


Expected Results:  
it should work ;-)

root:/home/xxx>emerge info
Portage 2.0.51.20-r4 (default-linux/x86/2005.0, gcc-3.4.3-20050110,
glibc-2.3.5-r0, 2.6.11-gentoo-r6 i686)
=================================================================
System uname: 2.6.11-gentoo-r6 i686 AMD Athlon(tm) XP 2400+
Gentoo Base System version 1.6.11
ccache version 2.4 [enabled]
dev-lang/python:     2.3.5
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.5
sys-devel/binutils:  2.15.92.0.2-r8
sys-devel/libtool:   1.5.14
virtual/os-headers:  2.6.11
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=athlon-xp -Os -fomit-frame-pointer -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib/X11/xkb /usr/share/config
/usr/share/cursors/xorg-x11/default/"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/texmf/web2c
/usr/share/cursors/xorg-x11/default/index.theme
/usr/share/scite/SciTEGlobal.properties /etc/env.d"
CXXFLAGS="-march=athlon-xp -Os -fomit-frame-pointer -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig ccache cvs digest distlocks nodoc noinfo sandbox sfperms
strict"
GENTOO_MIRRORS="http://pandemonium.tiscali.de/pub/gentoo/
http://mirror.switch.ch/mirror/gentoo/ http://ftp.du.se/pub/os/gentoo
http://mirrors.sec.informatik.tu-darmstadt.de/gentoo/ http://ftp.lug.ro/gentoo/
http://ftp.snt.utwente.nl/pub/os/linux/gentoo
http://www.die.unipd.it/pub/Linux/distributions/gentoo-sources/
http://gentoo.ITDNet.net/gentoo http://ftp.easynet.nl/mirror/gentoo/"
LANG="de_DE@euro"
LC_ALL="de_DE@euro"
LDFLAGS="-Wl,-O1 -Wl,--sort-common"
LINGUAS="de"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3dfx 3dnow X amd apm avi bitmap-fonts cdparanoia cdr cdrom cups divx4linux
dvd dvdr encode extensions f77 flac foomaticdb fortran gcj gif gimp gimpprint
gtk gtk2 imagemagick imlib java jpeg libwww linguas_de mixer mmap mmx motif
mozilla moznocompose moznoirc moznomail moznoxft mp3 mpeg multislot ncurses nls
nomac nptl nvidia oggvorbis opengl oss pdf pdflib perl pic png ppds print python
qt readline samba sdl sse ssl stencil-buffer svga tcltk tcpd tetex tiff truetype
truetype-fonts unicode usb userlocales x86 xine xv zlib"
Unset:  ASFLAGS, CTARGET
Comment 1 Stahl Sau 2005-04-25 12:26:22 UTC
oh dang, i forgot the version:
app-portage/gentoolkit-0.2.1_pre1
forgive me my noobishness ;(
Comment 2 Chris Smith 2005-04-25 12:51:53 UTC
Different error message but equery is not working:

~ $ equery
Traceback (most recent call last):
  File "/usr/bin/equery", line 31, in ?
    import gentoolkit.pprinter as pp
ImportError: No module named pprinter
Comment 3 Rob Cakebread (RETIRED) gentoo-dev 2005-04-25 13:07:14 UTC
It looks like there was a problem at one time with portage not cleaning out 
*.pyc files in /usr/lib/gentoolkit/pym

I had a very old /usr/lib/gentoolkit/pym/gentoolkit.pyc from way back when until just now, so equery was using it instead of the missing one that should have been one directory lower.

Chris you might want to unmerge gentoolkit and make sure there are no files left in /usr/lib/gentoolkit/pym before emerging a working version again.
Comment 4 Chris Smith 2005-04-25 13:42:23 UTC
>Chris you might want to unmerge gentoolkit and make sure there are no files left in /usr/lib/gentoolkit/pym before emerging a working version again.

Did that and now I get the same error as the reporter:

~ # equery
Traceback (most recent call last):
  File "/usr/bin/equery", line 27, in ?
    import gentoolkit
ImportError: No module named gentoolkit

Also only one file in /usr/lib/gentookit/pym:

~ # ls /usr/lib/gentoolkit/pym
glsa.py
Comment 5 Jakub Moc (RETIRED) gentoo-dev 2005-04-25 14:00:44 UTC
Unmerge/clean/remerge does not help at all... 

# equery belongs equery
Traceback (most recent call last):
  File "/usr/bin/equery", line 31, in ?
    import gentoolkit.pprinter as pp
ImportError: No module named pprinter
Comment 6 Paul Varner (RETIRED) gentoo-dev 2005-04-25 14:33:48 UTC
Created attachment 57221 [details, diff]
Patch for Makefile in gentoolkit-0.2.1_pre1/src/gentookit

I can verify this bug.	The problem is the following:

The file errors.py is missing from the gentoolkit-0.2.1_pre1/src/gentoolkit/
directory in the tarball.

The Makefile in the same directory needs to be updated to install all of the
python modules.

Additionally, there are some other errors that I am still working out.

If you need equery to work prior to this being fixed, then I would recommend
downgrading to gentoolkit-0.2.0
Comment 7 Rob Cakebread (RETIRED) gentoo-dev 2005-04-25 19:52:40 UTC
> Did that and now I get the same error as the reporter:

Right, I wasn't suggesting it as a fix, its just good to get rid of the stale file that was left around from some previous version. Thats why some of us had different error messages.
Comment 8 Paul Varner (RETIRED) gentoo-dev 2005-04-25 20:37:59 UTC
Created attachment 57237 [details]
Missing errors.py file from local copy of gentoolkit CVS
Comment 9 Paul Varner (RETIRED) gentoo-dev 2005-04-25 20:43:05 UTC
Created attachment 57238 [details, diff]
Patch to fix equery

The problem as far as I can tell was in the conversion of loading the
gentoolkit API as module to importing it as a package.	Here are the steps that
I used to fix it:

Note: where I say /path/to substitute the path where you saved the attachments.


$ emerge unmerge gentoolkit
$ cd /var/tmp/portage
$ rm -rf gentoolkit-0.2.1_pre1
$ env FEATURES="keepwork" emerge -v gentoolkit
$ cd
/var/tmp/portage/gentoolkit-0.2.1_pre1/work/gentoolkit-0.2.1_pre1/src/gentoolkit/

$ cp /path/to/errors.py .
$ patch < /path/to/gentoolkit.patch
$ cd
$ ebuild /usr/portage/app-portage/gentoolkit/gentoolkit-0.2.1_pre1.ebuild
install
$ ebuild /usr/portage/app-portage/gentoolkit/gentoolkit-0.2.1_pre1.ebuild
qmerge
Comment 10 Marius Mauch (RETIRED) gentoo-dev 2005-04-25 20:58:46 UTC
should be fixed in pre2
Comment 11 Allan Wang 2005-04-30 17:31:49 UTC
I'm having a somewhat similar error with gentoolkit-0.2.1-pre2. I wasn't sure if I should open a new bug or what, so I'm reopening this one.

aw ~ # equery
Traceback (most recent call last):
  File "/usr/bin/equery", line 27, in ?
    import gentoolkit
  File "/usr/lib/gentoolkit/pym/gentoolkit/__init__.py", line 37, in ?
    from helpers import *
  File "/usr/lib/gentoolkit/pym/gentoolkit/helpers.py", line 12, in ?
    from gentoolkit.package import *
ImportError: No module named package
aw ~ #

Downgrading gentoolkit to 0.2.0 fixes it.
Comment 12 Marius Mauch (RETIRED) gentoo-dev 2005-04-30 19:47:29 UTC
Does /usr/lib/gentoolkit/pym/package.py exist?
Comment 13 Allan Wang 2005-04-30 20:01:37 UTC
No, this is it:

aw pym # ls -lR
.:
total 52
drwxr-xr-x  2 root root   272 Apr 30 20:17 gentoolkit
-rw-r--r--  1 root root 21260 Apr 30 20:16 glsa.py
-rw-r--r--  1 root root 25308 Mar  5 15:36 glsa.pyc

./gentoolkit:
total 60
-rw-r--r--  1 root root    24 Apr 30 20:16 __init__.py
-rw-r--r--  1 root root   159 Apr 30 20:17 __init__.pyc
-rw-r--r--  1 root root  9598 Apr 30 20:16 gentoolkit.py
-rw-r--r--  1 root root 16975 Apr 30 20:17 gentoolkit.pyc
-rw-r--r--  1 root root  6677 Apr 30 11:04 helpers.pyc
-rw-r--r--  1 root root  1625 Apr 30 20:16 pprinter.py
-rw-r--r--  1 root root  5403 Apr 30 20:17 pprinter.pyc
Comment 14 Allan Wang 2005-04-30 20:04:17 UTC
Nevermind, somehow re-emerging it again fixes it.

I think I turned off AUTOCLEAN in make.conf and it may have broken stuff.