Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 237232 - emerge does not start: md5hash = _generate_hash_function("MD5", MD5.new, origin="pycrypto")
Summary: emerge does not start: md5hash = _generate_hash_function("MD5", MD5.new, orig...
Status: RESOLVED TEST-REQUEST
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-09 21:00 UTC by Albert Zeyer
Modified: 2009-05-18 15:34 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Albert Zeyer 2008-09-09 21:00:20 UTC
I exctracted the stage3-i686-2008.0.tar.bz2 (from http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/) to a new directory, binded the /dev and /proc to it and chrooted in it. When I try to call emerge, I get the following error:


macbook / # emerge --info
Traceback (most recent call last):
  File "/usr/bin/emerge", line 27, in ?
    import portage
  File "/usr/lib/portage/pym/portage.py", line 100, in ?
    from portage_manifest import Manifest
  File "/usr/lib/portage/pym/portage_manifest.py", line 10, in ?
    from portage_checksum import *
  File "/usr/lib/portage/pym/portage_checksum.py", line 59, in ?
    md5hash = _generate_hash_function("MD5", MD5.new, origin="pycrypto")
AttributeError: 'module' object has no attribute 'new'
macbook / # emerge
Traceback (most recent call last):
  File "/usr/bin/emerge", line 27, in ?
    import portage
  File "/usr/lib/portage/pym/portage.py", line 100, in ?
    from portage_manifest import Manifest
  File "/usr/lib/portage/pym/portage_manifest.py", line 10, in ?
    from portage_checksum import *
  File "/usr/lib/portage/pym/portage_checksum.py", line 59, in ?
    md5hash = _generate_hash_function("MD5", MD5.new, origin="pycrypto")
AttributeError: 'module' object has no attribute 'new'


Even env-update (as it import the python-module) has the same error:

macbook / # env-update
Traceback (most recent call last):
  File "/usr/sbin/env-update", line 27, in ?
    import portage
  File "/usr/lib/portage/pym/portage.py", line 100, in ?
    from portage_manifest import Manifest
  File "/usr/lib/portage/pym/portage_manifest.py", line 10, in ?
    from portage_checksum import *
  File "/usr/lib/portage/pym/portage_checksum.py", line 59, in ?
    md5hash = _generate_hash_function("MD5", MD5.new, origin="pycrypto")
AttributeError: 'module' object has no attribute 'new'


That is python2.4 in this stage3 archiv.
Comment 1 Albert Zeyer 2008-09-09 21:07:37 UTC
Perhaps related: The root-directory is a NFS-mount.
Comment 2 Albert Zeyer 2008-09-09 21:55:18 UTC
Here is a related bug:
http://ded.wiki.vianney.pl/Chrooted_Gentoo_on_Synology_DS-107#Fixing

Removing /usr/lib/python2.4/site-packages/Crypto solved the problem for me.
Comment 3 Albert Zeyer 2008-09-15 11:13:42 UTC
After I reemerged pycrypto (because I ran python-updater after I installed Python 2.5), the bug occurs again:

macbook portage # emerge
Traceback (most recent call last):
  File "/usr/bin/emerge", line 27, in <module>
    import portage
  File "/usr/lib/portage/pym/portage.py", line 100, in <module>
    from portage_manifest import Manifest
  File "/usr/lib/portage/pym/portage_manifest.py", line 10, in <module>
    from portage_checksum import *
  File "/usr/lib/portage/pym/portage_checksum.py", line 59, in <module>
    md5hash = _generate_hash_function("MD5", MD5.new, origin="pycrypto")
AttributeError: 'module' object has no attribute 'new'
macbook portage # 
Comment 4 Albert Zeyer 2008-09-15 11:16:08 UTC
This fixes again the problem:

macbook portage # cd /usr/lib/python2.5/site-packages/
macbook site-packages # rm -rf pycrypto-2.0.1-py2.5.egg-info Crypto


macbook site-packages # emerge --info
Portage 2.1.4.4 (default/linux/x86/2008.0/desktop, gcc-4.1.2, glibc-2.6.1-r0, 2.6.18-6-686 i686)
=================================================================
System uname: 2.6.18-6-686 i686 Intel(R) Core(TM)2 CPU T7400 @ 2.16GHz
Timestamp of tree: Sun, 14 Sep 2008 17:00:02 +0000
app-shells/bash:     3.2_p33
dev-java/java-config: 1.3.7, 2.1.6
dev-lang/python:     2.4.4-r13, 2.5.2-r7
dev-python/pycrypto: 2.0.1-r6
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.61-r2
sys-devel/automake:  1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.1
sys-devel/binutils:  2.18-r3
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.23-r3
ACCEPT_KEYWORDS="x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=nocona -pipe -ggdb"
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/config"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-O2 -march=nocona -pipe -ggdb"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks metadata-transfer parallel-fetch sandbox sfperms splitdebug unmerge-orphans userfetch"
GENTOO_MIRRORS="http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/ ftp:///ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/ ftp://ftp6.uni-erlangen.de/pub/mirrors/gentoo ftp://vlaai.snt.ipv6.utwente.nl/pub/os/linux/gentoo/ ftp://mirror.nutsmaas.nl/gentoo/"
LANG="en_US.UTF-8"
LC_ALL="en_US.UTF-8"
LDFLAGS="-Wl,-O1"
LINGUAS="de"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="7zip X a52 aac acl acpi alsa altenburgcards amarok amr amuled apm applet async asyncns atm automount avahi bash-completion berkdb bluetooth bonjour bookmarks branding bzip2 c++ cairo cdr cisco cli cracklib crypt cups cxx d daap dbus dedicated deskbar dga dhcp divx dri dv dvd dvdr dvdread dvi eap-tls eds emboss enblend encode esd evo exif extra-algorithms fam fasttrack ffmpeg firefox flac ftp galago gd gdbm german gif glib glitz gmedia gnome gnutella gnutls gphoto2 gpm gsf gstreamer gtk h323 hal haskell hddtemp hfs iconv icu id3 id3tag ieee1394 imlib injection inkjar ipv6 irda isdnlog isight jabber java javascript jit joystick jpeg jpeg2k kde kerberos kig-scripting kqemu latex lcms ldap libnotify lirc lm_sensors lua lzo macbook mad madwifi maps mdnsresponder-compat midi mikmod mmap mmx mng mozdevelop mp2 mp3 mp4 mpeg mplayer mtp mudflap music musicbrainz nautilus ncurses net network networking networkmanager njb nls nntp nptl nptlonly nsplugin ntfs ogg opengl openmp oss pam pascal pch pcre pdf perl pidgin plotutils pmu png pnm posix postgres postscript ppds pptp ps pth pulseaudio python qt3 qt3support qt4 quicktime rar rc5 rdesktop readline real realmedia reflection reiser4 reiserfs rtc samba screen sdl sdl-image sdl-sound sdlaudio server session sftp sharedmem sift slp smp sockets socks5 solver sourceview speex spell spl sse sse2 ssl ssse3 startup-notification subversion svg sysfs tetex theora threads threadsafe tiff timidity tk trayicon truetype unicode unzip usb v4l2 valgrind vcd video voice vorbis weak-algorithms wifi win32codecs wma wmp wxwindows x264 x86 xanim xattr xcomposite xext xface xine xml xmlreader xorg xrandr xscreensaver xulrunner xv xvid zeroconf zip zlib zsh-completion" ALSA_CARDS="hda-intel" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CAMERAS="sony_dscf1 sony_dscf55" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev wacom" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="de" LIRC_DEVICES="inputlirc macmini" USERLAND="GNU" VIDEO_CARDS="i810 vesa"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY

Comment 5 Jeroen Roovers (RETIRED) gentoo-dev 2008-09-15 14:39:02 UTC
(In reply to comment #1)
> Perhaps related: The root-directory is a NFS-mount.

Is that a case insensitive filesystem?
Comment 6 Albert Zeyer 2008-09-15 14:43:29 UTC
Yes, that is the same system again (the dir is located on a MacOSX).

Whereby I am not sure if this is really related to case sensitivity. It seems that also other people have run into this problem and I am not sure if they had a case insensitive fs.
Comment 7 Albert Zeyer 2008-09-15 14:44:31 UTC
Perhaps it imports for some reason the wrong MD5, perhaps there is also a md5 or something like this...
Comment 8 Albert Zeyer 2008-09-15 14:47:04 UTC
It is probably related to the case sensitivity. :)

http://en.wikipedia.org/wiki/Synology

This system has also a case insensitive fs.
Comment 9 Fabian Groffen gentoo-dev 2008-09-15 15:58:38 UTC
My prefix is also on an insensitive filesystem, and python/portage work fine there.  Could be that python doesn't expect linux to be case insensitive or something.

BTW: Python-2.5 doesn't need pycrypto any more

BTW2: why do you make your life so difficult with using a case insensitive filesystem for an operating system that's clearly not designed to use it?
Comment 10 Albert Zeyer 2008-09-15 16:42:23 UTC
(In reply to comment #9)
> BTW: Python-2.5 doesn't need pycrypto any more

Ah thanks for the hint. :) I just removed it now.

> BTW2: why do you make your life so difficult with using a case insensitive
> filesystem for an operating system that's clearly not designed to use it?

In this case, MacOSX is my host system. I am not using Gentoo on MacOSX yet (thought of this later) which would also push me into the same troubles. But I don't want to have multiple partitions on my system whereby Linux cannot access HFS+ (without problems) and MacOSX cannot access ReiserFS (at all) and I thought of running both systems also at the same time. Therefore I installed Gentoo in a VM via NFS on my HFS+ filesystem.
Comment 11 Zac Medico gentoo-dev 2008-11-13 17:36:28 UTC
(In reply to comment #3)
> After I reemerged pycrypto (because I ran python-updater after I installed
> Python 2.5), the bug occurs again:
> 
> macbook portage # emerge
> Traceback (most recent call last):
>   File "/usr/bin/emerge", line 27, in <module>
>     import portage
>   File "/usr/lib/portage/pym/portage.py", line 100, in <module>
>     from portage_manifest import Manifest
>   File "/usr/lib/portage/pym/portage_manifest.py", line 10, in <module>
>     from portage_checksum import *
>   File "/usr/lib/portage/pym/portage_checksum.py", line 59, in <module>
>     md5hash = _generate_hash_function("MD5", MD5.new, origin="pycrypto")
> AttributeError: 'module' object has no attribute 'new'
> macbook portage # 
> 

Seems to be something going wrong with pycrypto.

In >=portage-2.2_rc14, portage no longer imports Crypto.Hash.MD5 because it generates warnings with python-2.6 due to being implemented with python's stdlib md5 module.
Comment 12 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2009-05-18 15:34:10 UTC
Please test with the newest versions of Python and Portage.