Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 198447 - dev-lang/python-2.5.1-r3: After installation of binary package, python broken
Summary: dev-lang/python-2.5.1-r3: After installation of binary package, python broken
Status: RESOLVED INVALID
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: High blocker with 1 vote (vote)
Assignee: Python Gentoo Team
URL: http://public-files.askwar.gentoo-pac...
Whiteboard:
Keywords:
: 245162 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-11-08 13:12 UTC by Alexander Skwar
Modified: 2009-03-10 04:02 UTC (History)
3 users (show)

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


Attachments
/etc/make.conf (make.conf,4.72 KB, text/plain)
2007-11-08 13:13 UTC, Alexander Skwar
Details
/etc/portage/package.use (package.use,1.22 KB, text/plain)
2007-11-08 13:13 UTC, Alexander Skwar
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Skwar 2007-11-08 13:12:23 UTC
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.
Comment 1 Alexander Skwar 2007-11-08 13:13:22 UTC
Created attachment 135484 [details]
/etc/make.conf
Comment 2 Alexander Skwar 2007-11-08 13:13:42 UTC
Created attachment 135485 [details]
/etc/portage/package.use
Comment 3 Marius Mauch (RETIRED) gentoo-dev 2007-11-08 14:55:09 UTC
It's python that's borked, not portage.
Comment 4 Alexander Skwar 2007-11-08 14:58:48 UTC
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.
Comment 5 Marius Mauch (RETIRED) gentoo-dev 2007-11-08 15:36:37 UTC
No surprise, as the binary package is the issue (it's apparently missing at least one file).
Comment 6 Alexander Skwar 2007-12-06 11:09:10 UTC
Any progress on making --buildpkg work with python?
Comment 7 Zac Medico gentoo-dev 2007-12-06 17:21:47 UTC
(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.
Comment 8 Ali Polatel (RETIRED) gentoo-dev 2008-01-04 16:06:53 UTC
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?
Comment 9 Zac Medico gentoo-dev 2008-11-05 00:11:24 UTC
*** Bug 245162 has been marked as a duplicate of this bug. ***
Comment 10 ade05fr 2008-11-05 08:32:31 UTC
is there any solution ???

(In reply to comment #9)
> *** Bug 245162 has been marked as a duplicate of this bug. ***
> 

Comment 11 Zac Medico gentoo-dev 2008-11-05 08:43:56 UTC
You can try manually unpacking a python tarball from the tinderbox:

http://tinderbox.dev.gentoo.org/html/
Comment 12 ade05fr 2008-11-10 14:40:12 UTC
(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
Comment 13 karpi 2009-03-09 12:03:27 UTC
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..


Comment 14 Jesus Rivero (RETIRED) gentoo-dev 2009-03-10 04:02:58 UTC
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,