I just now installed dev-lang/python-2.5.1-r3 on a system from a binary package by running: emerge --usepkgonly -v =dev-lang/python-2.5.1-r3 After having done that, portage is broken: winnb000488 / # emerge !!! Failed to complete portage imports. There are internal modules for !!! portage and failure here indicates that you have a problem with your !!! installation of portage. Please try a rescue portage located in the !!! portage tree under '/usr/portage/sys-apps/portage/files/' (default). !!! There is a README.RESCUE file that details the steps required to perform !!! a recovery of portage. No module named _md5 !!! Failed to complete portage imports. There are internal modules for !!! portage and failure here indicates that you have a problem with your !!! installation of portage. Please try a rescue portage located in the !!! portage tree under '/usr/portage/sys-apps/portage/files/' (default). !!! There is a README.RESCUE file that details the steps required to perform !!! a recovery of portage. No module named _md5 Traceback (most recent call last): File "/usr/bin/emerge", line 31, in <module> import portage File "/usr/lib/portage/pym/portage.py", line 56, in <module> import getbinpkg File "/usr/lib/portage/pym/getbinpkg.py", line 10, in <module> import htmllib,HTMLParser,formatter,sys,os,xpak,time,tempfile,base64,urllib2 File "/usr/lib/python2.5/urllib2.py", line 88, in <module> import hashlib File "/usr/lib/python2.5/hashlib.py", line 133, in <module> md5 = __get_builtin_constructor('md5') File "/usr/lib/python2.5/hashlib.py", line 60, in __get_builtin_constructor import _md5 ImportError: No module named _md5 I cannot run /usr/sbin/python-updater. If I try to, I get the same error message: winnb000488 / # /usr/sbin/python-updater !!! Failed to complete portage imports. There are internal modules for !!! portage and failure here indicates that you have a problem with your !!! installation of portage. Please try a rescue portage located in the !!! portage tree under '/usr/portage/sys-apps/portage/files/' (default). !!! There is a README.RESCUE file that details the steps required to perform !!! a recovery of portage. No module named _md5 !!! Failed to complete portage imports. There are internal modules for !!! portage and failure here indicates that you have a problem with your !!! installation of portage. Please try a rescue portage located in the !!! portage tree under '/usr/portage/sys-apps/portage/files/' (default). !!! There is a README.RESCUE file that details the steps required to perform !!! a recovery of portage. No module named _md5 Traceback (most recent call last): File "/usr/bin/portageq", line 346, in <module> main() File "/usr/bin/portageq", line 338, in main import portage File "/usr/lib/portage/pym/portage.py", line 56, in <module> import getbinpkg File "/usr/lib/portage/pym/getbinpkg.py", line 10, in <module> import htmllib,HTMLParser,formatter,sys,os,xpak,time,tempfile,base64,urllib2 File "/usr/lib/python2.5/urllib2.py", line 88, in <module> import hashlib File "/usr/lib/python2.5/hashlib.py", line 133, in <module> md5 = __get_builtin_constructor('md5') File "/usr/lib/python2.5/hashlib.py", line 60, in __get_builtin_constructor import _md5 ImportError: No module named _md5 I tried to do a portage rescue installation as described on http://www.gentoo.org/proj/en/portage/doc/manually-fixing-portage.xml, and that also did not change anything. The python tbz2 package can be found at the URL http://public-files.askwar.gentoo-packages.s3.amazonaws.com/GentooUSB/packages/All/ -> http://public-files.askwar.gentoo-packages.s3.amazonaws.com/GentooUSB/packages/All/python-2.5.1-r3.tbz2 emerge --info cannot be provided, as emerge does not work. To get myself into the situation I'm in, I installed stage3-i686-2007.0.tar and portage-20071007.tar. After that, I did a "emerge --sync" and modified make.conf and /etc/portage/package.use (will be attached). Then I build a binary package of python-2.5.1-r3 in a different installation (based on the same make.conf and package.use). And finally I tried to install the binary package. Result: Breakage.
Created attachment 135484 [details] /etc/make.conf
Created attachment 135485 [details] /etc/portage/package.use
It's python that's borked, not portage.
Well, okay. Effect is, that portage doesn't work :) Anyway. The breakage really IS reproducible. Insall stage3-i686-2007.0.tar, install a current portage tree, use attached make.conf & package.use and run emerge -v --usepkgonly python Result: Broken.
No surprise, as the binary package is the issue (it's apparently missing at least one file).
Any progress on making --buildpkg work with python?
(In reply to comment #6) > Any progress on making --buildpkg work with python? AFAIK, --buildpkg usually works with python as well as any other package. According to comment #4 you were using --usepkgonly. Of course it's reproducible using the _same_ binary package. Can you reproducibly build a bad binary package though? If it was easily reproducible, then more people would have reported this.
I can't reproduce the problem here. Can you reproduce a bad binary package as Zac said? If yes, can you try re-emerging openssl and try again?
*** Bug 245162 has been marked as a duplicate of this bug. ***
is there any solution ??? (In reply to comment #9) > *** Bug 245162 has been marked as a duplicate of this bug. *** >
You can try manually unpacking a python tarball from the tinderbox: http://tinderbox.dev.gentoo.org/html/
(In reply to comment #11) > You can try manually unpacking a python tarball from the tinderbox: > > http://tinderbox.dev.gentoo.org/html/ > i solved my problem with a method to recover portage : "Manually fixing broken portage installations" thanks
Hello, ive fallen into this horrible bug too. Only upgreading one old system, following conflict instruction in order to install e2fsprogs ive unmerged ss, mktemp, com_err -> and portage becomes totally unusable. Nothig do with python, but this error appears: ImportError: No module named _md5 Ive manually repaired this: Find somewhere 4 files and copy them into broken system: /usr/lib/python2.5/lib-dynload/_md5.so /usr/lib/python2.5/lib-dynload/_sha.so /usr/lib/python2.5/lib-dynload/_sha256.so /usr/lib/python2.5/lib-dynload/_sha512.so it works for me..
Hello, This is due to a broken python. Missing files in a python installation in Gentoo is BAD. Please, if you broke, missed, misplaced or played with your existing python and get this error, please follow Zac's advice and install python from tinderbox and then emerge python again. Closing this bug as invalid. Best regards,