Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Bad magic number in .../emergehelp.pyo
View unanswered posts
View posts from last 24 hours

rackathon
 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
timeBandit
Moderator
Moderator


Joined: 30 Dec 2004
Posts: 2115
Location: here, there or in transit

PostPosted: Sat Nov 17, 2007 10:48 am    Post subject: [SOLVED] Bad magic number in .../emergehelp.pyo Reply with quote

I'm beginning my more-or-less-annual world update and I'm off to a rocky start. :|
After updating Portage, emerge was broken as follows:
Code:
Traceback (most recent call last):
  File "/usr/bin/emerge", line 35, in ?
    import emergehelp, xpak, commands, errno, re, socket, time, types
ImportError: Bad magic number in /usr/lib/portage/bin/emergehelp.pyo

A little investigation turned up two different byte-code versions of that module:
Code:
~ # cd /usr/lib/portage/bin
bin # ll emergehelp*
-rw-r--r-- 1 root root 21804 2004-03-11 22:50 emergehelp.pyc
-rw-r--r-- 1 root root 20853 2003-11-14 22:35 emergehelp.pyo
bin # file emergehelp.pyc
emergehelp.pyc: python 2.2 byte-compiled
bin # file emergehelp.pyo
emergehelp.pyo: python 2.2 byte-compiled

Removing the offending file seemed to convince Python to pick up the newer one:
Code:
bin # mv emergehelp.pyo _emergehelp.pyo
bin # emerge --info
Portage 2.1.3.19 (default-linux/x86/2006.1/desktop, gcc-3.4.6, glibc-2.4-r4, 2.6.17-gentoo-r8 i686)
=================================================================
System uname: 2.6.17-gentoo-r8 i686 Intel(R) Pentium(R) 4 CPU 2.40GHz
Timestamp of tree: Sat, 17 Nov 2007 03:46:01 +0000
app-shells/bash:     3.2_p17
dev-java/java-config: 1.3.7, 2.0.30
dev-lang/python:     2.4.3-r4
dev-python/pycrypto: 2.0.1-r5
sys-apps/baselayout: 1.12.6
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.61
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.16.1-r3
sys-devel/gcc-config: 1.3.14
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.17-r2
ACCEPT_KEYWORDS="x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=pentium4 -fomit-frame-pointer -fprefetch-loop-arrays -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/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/splash /etc/terminfo"
CXXFLAGS="-O2 -march=pentium4 -fomit-frame-pointer -fprefetch-loop-arrays -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks metadata-transfer parallel-fetch sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://mirrors.tds.net/gentoo ftp://mirrors.tds.net/gentoo http://gentoo.oregonstate.edu http://www.ibiblio.org/pub/Linux/distributions/gentoo"
LANG="en_US.utf8"
LC_ALL="en_US.utf8"
LINGUAS="en en_US de"
MAKEOPTS="-j3"
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 --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage"
USE="X acpi alsa apache2 berkdb bitmap-fonts bzip2 cairo cdr cli cracklib crypt cups dbus dri dvd dvdr eds emboss encode esd fam firefox fortran gdbm gif gnome gpm gstreamer gtk hal iconv ipv6 isdnlog java jpeg kerberos krb4 lcms mad mbox midi mikmod mmx moznoirc moznomail mozsvg mp3 mpeg mudflap mysql ncurses nls nptl nptlonly ogg opengl openmp oss pam pcre perl png ppds pppd python qt3 quicktime readline reflection samba sdl session spell spl sse ssl tcpd tiff truetype truetype-fonts type1-fonts unicode usb vorbis win32codecs wmf x86 xml xorg xv zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="keyboard mouse wacom" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en en_US de" USERLAND="GNU" VIDEO_CARDS="nvidia fbdev vesa vga"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LDFLAGS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

I re-merged Portage to be safe and it finished without error this time. Any chance I now have a half-and-half Portage installation, with mixed pieces from different versions? I'd like to be sure Portage is A-OK before I move on...there are scary monsters like expat lurking about and I want to face them fully-armed. :)
_________________
Plants are pithy, brooks tend to babble--I'm content to lie between them.
Super-short f.g.o checklist: Search first, strip comments, mark solved, help others.


Last edited by timeBandit on Sat Nov 17, 2007 9:36 pm; edited 1 time in total
Back to top
View user's profile Send private message
Genone
Retired Dev
Retired Dev


Joined: 14 Mar 2003
Posts: 7742
Location: beyond the rim

PostPosted: Sat Nov 17, 2007 12:28 pm    Post subject: Reply with quote

There shouldn't be any problems with removing byte-code files.
Back to top
View user's profile Send private message
timeBandit
Moderator
Moderator


Joined: 30 Dec 2004
Posts: 2115
Location: here, there or in transit

PostPosted: Sat Nov 17, 2007 9:34 pm    Post subject: Reply with quote

I knew the Shadow would know ... :wink:
Thanks--I thought as much but wanted to be sure.
_________________
Plants are pithy, brooks tend to babble--I'm content to lie between them.
Super-short f.g.o checklist: Search first, strip comments, mark solved, help others.
Back to top
View user's profile Send private message
geta
Apprentice
Apprentice


Joined: 10 May 2003
Posts: 153

PostPosted: Fri Jan 04, 2008 6:15 am    Post subject: Reply with quote

Thanks a lot!

This useful and small tip has helped me out, even if it's about three years later.

The problem appeared, when I touched an old computer that I hadn't run in about 1.5 years and the first thing I ran was "emerge -av --oneshot portage"

Once again the gentoo forums has saved my day and shortened my error searching by one to two hours :D

Cheers,
geta
_________________
geta - pronounced: "djetta"
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum