after I upgraded to portage-2.1_pre10_r2 , the python interpreter fails with the message: Could not find platform dependent libraries <exec_prefix> Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] This looks very similar to bug 46898 from 2004. However, in my case both python-2.3 and python-2.4 have broken, making portage tools unusable and the situation difficult to fix. Now whenever I start python I get the error somers@alanine ~/archive/pics/thanksgiving_2005 $ python2.4 -v Could not find platform dependent libraries <exec_prefix> Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] # installing zipimport hook import zipimport # builtin # installed zipimport hook # /usr/lib/python2.4/site.pyc matches /usr/lib/python2.4/site.py import site # precompiled from /usr/lib/python2.4/site.pyc # /usr/lib/python2.4/os.pyc matches /usr/lib/python2.4/os.py import os # precompiled from /usr/lib/python2.4/os.pyc import posix # builtin # /usr/lib/python2.4/posixpath.pyc matches /usr/lib/python2.4/posixpath.py import posixpath # precompiled from /usr/lib/python2.4/posixpath.pyc # /usr/lib/python2.4/stat.pyc matches /usr/lib/python2.4/stat.py import stat # precompiled from /usr/lib/python2.4/stat.pyc # /usr/lib/python2.4/UserDict.pyc matches /usr/lib/python2.4/UserDict.py import UserDict # precompiled from /usr/lib/python2.4/UserDict.pyc # /usr/lib/python2.4/copy_reg.pyc matches /usr/lib/python2.4/copy_reg.py import copy_reg # precompiled from /usr/lib/python2.4/copy_reg.pyc # /usr/lib/python2.4/types.pyc matches /usr/lib/python2.4/types.py import types # precompiled from /usr/lib/python2.4/types.pyc # /usr/lib/python2.4/warnings.pyc matches /usr/lib/python2.4/warnings.py import warnings # precompiled from /usr/lib/python2.4/warnings.pyc # /usr/lib/python2.4/linecache.pyc matches /usr/lib/python2.4/linecache.py import linecache # precompiled from /usr/lib/python2.4/linecache.pyc import encodings # directory /usr/lib/python2.4/encodings # /usr/lib/python2.4/encodings/__init__.pyc matches /usr/lib/python2.4/encodings/__init__.py import encodings # precompiled from /usr/lib/python2.4/encodings/__init__.pyc # /usr/lib/python2.4/codecs.pyc matches /usr/lib/python2.4/codecs.py import codecs # precompiled from /usr/lib/python2.4/codecs.pyc import _codecs # builtin # /usr/lib/python2.4/encodings/aliases.pyc matches /usr/lib/python2.4/encodings/aliases.py import encodings.aliases # precompiled from /usr/lib/python2.4/encodings/aliases.pyc # /usr/lib/python2.4/encodings/ascii.pyc matches /usr/lib/python2.4/encodings/ascii.py import encodings.ascii # precompiled from /usr/lib/python2.4/encodings/ascii.pyc Python 2.4.2 (#1, Oct 8 2005, 12:27:29) [GCC 3.4.4 (Gentoo 3.4.4-r1, ssp-3.4.4-1.0, pie-8.7.8)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> or for python-2.3: somers@alanine ~/archive/pics/thanksgiving_2005 $ python2.3 -v Could not find platform independent libraries <prefix> Could not find platform dependent libraries <exec_prefix> Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] # installing zipimport hook import zipimport # builtin # installed zipimport hook 'import site' failed; traceback: ImportError: No module named site Python 2.3.5 (#1, Oct 30 2005, 09:23:46) [GCC 3.4.4 (Gentoo 3.4.4-r1, ssp-3.4.4-1.0, pie-8.7.8)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> I don't know why I could import zipimport, because site fails, as does os, pickle, and struct, which are all I tried. If I set PYTHONHOME=/usr/lib/python2.4/ and export it, then all my modules fail just like they did for python2.3 . somers@alanine ~/archive/pics/thanksgiving_2005 $ python2.4 -v # installing zipimport hook import zipimport # builtin # installed zipimport hook 'import site' failed; traceback: ImportError: No module named site Python 2.4.2 (#1, Oct 8 2005, 12:27:29) [GCC 3.4.4 (Gentoo 3.4.4-r1, ssp-3.4.4-1.0, pie-8.7.8)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> /var/tmp/portage/portage-2.1_pre10-r2 has been automatically deleted, so I can't examine it. And without a working installation of python, I can't update anything. Is there some way to make a working python tree in another directory or on a cd-rom, and use that tree to run emerge? I can't do emerge --info for obvious reasons, but I found the output of emerge --info from an older bug report from feb-3-2006 : emerge info: Portage 2.1_pre3-r1 (default-linux/amd64/2005.0, gcc-3.3.4, glibc-2.3.5-r3, 2.6.1 5 x86_64) ================================================================= System uname: 2.6.15 x86_64 AMD Opteron(tm) Processor 244 Gentoo Base System version 1.12.0_pre8 distcc 2.18.3 x86_64-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabl ed] dev-lang/python: 2.3.5-r2, 2.4.2 sys-apps/sandbox: 1.2.13 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-r1 sys-devel/binutils: 2.16.1 sys-devel/libtool: 1.5.20 virtual/os-headers: 2.6.11-r2 ACCEPT_KEYWORDS="amd64 ~amd64" AUTOCLEAN="yes" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-O0" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env /usr/kde/3.4/share/ config /usr/kde/3.4/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/lib64/ mozilla/defaults/pref /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/sha re/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/ platex/config/ /usr/share/texmf/xdvi/ /var/qmail/alias /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-O0" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig ccache distlocks sfperms strict" GENTOO_MIRRORS="http://gentoo.binarycompass.org http://gentoo.osuosl.org/ http:// gentoo.ccccom.com" MAKEOPTS="-j3" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage" USE="amd64 X aalib acpi aim alsa apache2 audiofile avi berkdb bitmap-fonts bonobo bzip2 crypt cups curl dga divx4linux doc dts dvd eds emboss encode exif expat fa m fbcon fftw flac foomaticdb fortran gd gdbm gif glut gmp gphoto2 gpm gstreamer g tk gtk2 gtkhtml guile idn imagemagick imlib ipv6 jack java jpeg lcms ldap libcaca libwww lzw lzw-tiff mad maildir mbox mikmod mng mozilla mp3 mpeg mysql ncurses n ls nptl offensive ogg oggvorbis opengl oscar pam pam_chroot pcre pda pdflib perl plotutils png python qt quicktime readline real recode samba sdl sharedmem slang sockets spell sqlite ssl sysvipc tcltk tcpd tetex tiff truetype truetype-fonts ty pe1-fonts udev usb userlocales vorbis xanim xinerama xml xml2 xmms xpm xv xvid zl ib elibc_glibc kernel_linux userland_GNU" Unset: ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS
The problem appears to be that my library symlinks are screwed up. /usr/lib64 is a symlink to itself: somers@alanine /usr $ ls -ld lib* drwxr-xr-x 140 somers users 73728 May 9 20:23 lib drwxr-xr-x 10 root root 4096 Apr 25 11:15 lib32 lrwxrwxrwx 1 root root 8 May 5 12:36 lib64 -> ../lib64 drwxr-xr-x 9 root root 4096 Feb 3 20:05 libexec From examining my backups, I see that before the upgrade lib and lib32 were directories and lib64 was a symlink to lib . According to http://dev.gentoo.org/~plasmaroo/devmanual/archs/amd64/ , lib64 and lib32 should be directories and lib should be a symlink to lib64 . I will try fixing this manually to see what happens, but first I am submitting this bugnote to document my progress in case I fubar my system
if you need to recover, you can run `bb` ... that'll start up a static recovery shell which has many commands like `mv`, `ln`, `rm`, etc...
Fixing it manually worked. I then tried successfully to recreate the problem by restoring the symlinks to their incorrect (but working) values and reemerging. I discovered that emerging portage worked. The problem came from emerging xorg-x11-6.8.2-r7 . When this bug happened the first time was after I emerged portage and xorg-x11 . The emerge of xorg-x11 did not finish, so I assumed incorrectly that it did not change my system. It turns out that that ebuild attempts to fix the symlinks with the commands: # Migration fubars lib symlinks -- eradicator if use amd64; then if [[ -L ${ROOT}usr/lib64 ]]; then rm ${ROOT}usr/lib64 ln -s lib ${ROOT}usr/lib64 elif [[ -L ${ROOT}usr/lib ]]; then rm -f ${ROOT}usr/lib ln -s lib64 ${ROOT}usr/lib elif [[ -L ${ROOT}usr/lib32 ]]; then if has_multilib_profile; then ln -s lib ${ROOT}usr/lib32 else ln -s ../emul/linux/x86/usr/lib ${ROOT}usr/lib32 fi fi I don't understand why those commands produced the error, but they must be the culprit. I used screen to take a log of the emerge process, but it's almost 10MB so I won't upload it unless somebody asks. The command that changed the symlink doesn't appear to be echoed.
*** This bug has been marked as a duplicate of 132135 ***