Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
ImportError: No module named _elementtree [solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
Carlino
Guru
Guru


Joined: 25 May 2005
Posts: 365
Location: Bordeaux, France

PostPosted: Sat May 29, 2010 2:43 pm    Post subject: ImportError: No module named _elementtree [solved] Reply with quote

Hello,
running a regular and ordinary " emerge -Du world", I'm bumping into this ugly failure :
Code:
 * ERROR: dev-java/commons-codec-1.4 failed:
 *   build-xml-rewrite failed
 *
 * Call stack:
 *     ebuild.sh, line   54:  Called src_configure
 *   environment, line 4406:  Called java-ant-2_src_configure
 *   environment, line 2207:  Called java-ant_bsfix
 *   environment, line 2229:  Called java-ant_bsfix_files './build.xml'
 *   environment, line 2269:  Called die
 * The specific snippet of code:
 *               ${rewriter4} ${gcp} ${enc} -c "${JAVA_PKG_BSFIX_SOURCE_TAGS}" source ${want_source} -c "${JAVA_PKG_BSFIX_TARGET_TAGS}" target ${want_target} "${@}" || die "build-xml-rewrite failed";

From what I've read crawling around, it might occur from updating Python 2.6 to 3.1....

Code:
# emerge --info =dev-java/commons-codec-1.4
Portage 2.1.8.3 (default/linux/amd64/10.0/desktop, gcc-4.4.3, glibc-2.10.1-r1, 2.6.32-gentoo-r7 x86_64)
=================================================================
                        System Settings
=================================================================
System uname: Linux-2.6.32-gentoo-r7-x86_64-Intel-R-_Core-TM-2_Quad_CPU_Q9400_@_2.66GHz-with-gentoo-1.12.13
Timestamp of tree: Fri, 28 May 2010 22:00:01 +0000
distcc 3.1 x86_64-pc-linux-gnu [enabled]
app-shells/bash:     4.0_p37
dev-java/java-config: 2.1.10
dev-lang/python:     2.6.5-r2, 3.1.2-r3
dev-util/cmake:      2.6.4-r3
sys-apps/baselayout: 1.12.13
sys-apps/sandbox:    1.6-r2
sys-devel/autoconf:  2.13, 2.65
sys-devel/automake:  1.8.5-r3, 1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:  2.18-r3
sys-devel/gcc:       4.3.4, 4.4.3-r2
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6b
virtual/os-headers:  2.6.30-r1
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA Q3AEULA dlj-1.1 sun-bcla-java-vm"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=nocona -pipe"
CHOST="x86_64-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 /var/lib/hsqldb"
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/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -march=nocona -pipe"
DISTDIR="/usr/portages/packages"
FEATURES="assume-digests distcc distlocks fixpackages news parallel-fetch protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="ftp://ftp.free.fr/mirrors/ftp.gentoo.org/ http://213.186.33.37/gentoo-distfiles/ ftp://213.186.33.38/gentoo-distfiles/ ftp://213.186.33.37/gentoo-distfiles/ http://mirror.qubenet.net/mirror/gentoo/"
LANG="fr_FR@euro"
LDFLAGS="-Wl,-O1"
LINGUAS="fr fr_FR"
MAKEOPTS="-j5"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
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="3dnow 3dnowext 64bit X a52 aac abiword accessibility acl acpi alisp alsa amazon amd64 antlr apache2 arts asyncns bcel berkdb bitmap-fonts bluetooth branding bsf build bzip2 cairo caps cdda cdr cli clucene commonslogging commonsnet community consolekit corefonts cracklib crypt css ctype cups cxx dbus devfs-compat device-mapper dlloader dri dso dts dvd dvdr dvdread eds embedded emboss encode esd exif external-fuse extras fam fbcondecor ffmpeg firefox flac fltk fortran fts3 gcrypt gd gdbm gdu gecko gif gnome gpm gstreamer gtk hal handbook hardcoded-tables iconv ipv6 isdnlog jack java javamail jce jdepend jpeg jsch kde kdrive kerberos lcms ldap libburn libclamav libg++ libnotify libsamplerate lirc log4j mad midi mikmod mmx mmxext mng modplug modules mp3 mp4 mpeg mudflap multilib musepack mysql ncurses nls nptl nptlonly nsplugin oav ogg opengl openmp oro oss pam pango pcre pdf perl pg-intdatetime png policykit poppler-data postgres ppds pppd pulseaudio python qt3 qt3support qt4 quicktime raptor readline reflection regexp resolver samba sasl sdl semantic-desktop session sha512 sndfile source speex spell spl sqlite sse sse2 ssl ssse3 startup-notification svg swat sysfs tcpd theora threads threadsafe tiff truetype truetype-fonts udev unicode usb utils v4l video vorbis wav wavpack webdav-neon webmin-minimal x264 xcb xine xml xorg xpdf-headers xscreensaver xulrunner xv xvid zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw copy dshare dsnoop empty extplug file hooks ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm" 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" ELIBC="glibc" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="fr fr_FR" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="radeon vesa vga" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY

Code:
# eselect python list
Available Python interpreters:
  [1]   python2.6 *
  [2]   python3.1

_________________
Core 2 Quad 9400, Asus PQ5 Pro, Nvidia Geforce GTX 66O


Last edited by Carlino on Sun May 30, 2010 5:28 pm; edited 2 times in total
Back to top
View user's profile Send private message
Mike Hunt
Watchman
Watchman


Joined: 19 Jul 2009
Posts: 5287

PostPosted: Sat May 29, 2010 3:03 pm    Post subject: Reply with quote

Maybe running python-updater and/or rebuilding python will help. Not sure.

Maybe with something like this: OpenJDK Runtime Environment (IcedTea6 1.8 ) (Gentoo build 1.6.0_18-b18)
OpenJDK 64-Bit Server VM (build 16.0-b13, mixed mode)

Check eselect java-vm list
Back to top
View user's profile Send private message
Carlino
Guru
Guru


Joined: 25 May 2005
Posts: 365
Location: Bordeaux, France

PostPosted: Sat May 29, 2010 3:37 pm    Post subject: Reply with quote

I did run python-updater ; I'm gonna try to rebuild it

Code:
eselect java-vm list
Available Java Virtual Machines:
  [1]   icedtea6-bin
  [2]   sun-jdk-1.5
  [3]   sun-jdk-1.6  system-vm



Note : I've just rebuilt Python and then ran emerge on dev-java/commons-codec-1.4, but same failure
_________________
Core 2 Quad 9400, Asus PQ5 Pro, Nvidia Geforce GTX 66O
Back to top
View user's profile Send private message
Carlino
Guru
Guru


Joined: 25 May 2005
Posts: 365
Location: Bordeaux, France

PostPosted: Sun May 30, 2010 1:42 pm    Post subject: Reply with quote

I've updated the subject's title since, from what I'm reading around, this issue I'm having is not directly related to java, but most certainly, has something to do with Python. Actually, what comes out from the emerge log points it :
Code:
Configuring source in /vall /usr/lib64/python2.6/xml/etree/cElementTree.py
-rw-r--r-- 1 root root 62 26 mai   07:29 /usr/lib64/python2.6/xml/etree/cElementTree.py
r/tmp/portage/dev-java/commons-codec-1.4/work/commons-codec-1.4-src ...
cElementTree rewriter
Traceback (most recent call last):
  File "/usr/lib64/javatoolkit/bin/build-xml-rewrite", line 4, in <module>
    import xml.etree.cElementTree as et
  File "/usr/lib64/python2.6/xml/etree/cElementTree.py", line 3, in <module>
    from _elementtree import *
ImportError: No module named _elementtree
 * ERROR: dev-java/commons-codec-1.4 failed:
 *   build-xml-rewrite failed
 *

Something with Python and some cElementTree
still :
Code:
ll /usr/lib64/python2.6/xml/etree/cElementTree.py
-rw-r--r-- 1 root root 62 26 mai   07:29 /usr/lib64/python2.6/xml/etree/cElementTree.py

I'm trying to find out ...
_________________
Core 2 Quad 9400, Asus PQ5 Pro, Nvidia Geforce GTX 66O
Back to top
View user's profile Send private message
Anon-E-moose
Watchman
Watchman


Joined: 23 May 2008
Posts: 6095
Location: Dallas area

PostPosted: Sun May 30, 2010 1:50 pm    Post subject: Reply with quote

this is what is inside cElementTree.py

Code:
# Wrapper module for _elementtree

from _elementtree import *


It may want dev-python/elementtree installed, if you don't have it.



One other thing, are you running emerge as root?
_________________
PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland
Back to top
View user's profile Send private message
Carlino
Guru
Guru


Joined: 25 May 2005
Posts: 365
Location: Bordeaux, France

PostPosted: Sun May 30, 2010 3:25 pm    Post subject: Reply with quote

That's what I figured out also, so I emerged it, as well as dev-python/celementtree, but the problem remains...

Code:
# python -c 'import xml.etree.ElementTree'
doesn't return nothing, which is supposed to be fin from what I'm reading.
But, I got this:
Code:
# python -c 'import xml.etree.cElementTree'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib64/python2.6/xml/etree/cElementTree.py", line 3, in <module>
    from _elementtree import *
ImportError: No module named _elementtree

which obviously sucks....
_________________
Core 2 Quad 9400, Asus PQ5 Pro, Nvidia Geforce GTX 66O
Back to top
View user's profile Send private message
Anon-E-moose
Watchman
Watchman


Joined: 23 May 2008
Posts: 6095
Location: Dallas area

PostPosted: Sun May 30, 2010 4:43 pm    Post subject: Reply with quote

You should have a /usr/lib/python2.6/lib-dynload/_elementtree.so file

There is a bug report about that problem but it was back in the python-2.4 days
https://bugs.gentoo.org/235650

Might be a hint in there
_________________
PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland
Back to top
View user's profile Send private message
dol-sen
Retired Dev
Retired Dev


Joined: 30 Jun 2002
Posts: 2805
Location: Richmond, BC, Canada

PostPosted: Sun May 30, 2010 4:44 pm    Post subject: Reply with quote

Code:
Help on module _elementtree:

NAME
    _elementtree

FILE
    /usr/lib64/python2.6/lib-dynload/_elementtree.so
...

Code:
big_daddy brian # equery b _elementtree.so
 * Searching for _elementtree.so ...
dev-lang/python-2.5.4-r4 (/usr/lib64/python2.5/lib-dynload/_elementtree.so)
dev-lang/python-2.6.5-r2 (/usr/lib64/python2.6/lib-dynload/_elementtree.so)
dev-lang/python-3.1.2-r3 (/usr/lib64/python3.1/lib-dynload/_elementtree.so)
big_daddy brian #


So it is your python that is broken
_________________
Brian
Porthole, the Portage GUI frontend irc@freenode: #gentoo-guis, #porthole, Blog
layman, gentoolkit, CoreBuilder, esearch...
Back to top
View user's profile Send private message
Carlino
Guru
Guru


Joined: 25 May 2005
Posts: 365
Location: Bordeaux, France

PostPosted: Sun May 30, 2010 5:28 pm    Post subject: Reply with quote

I've downgraded python to 2.6.5, re-emerged -pvDu world, and this time, I could emerged all packages nicely ! But python 3 was not available anymore

Thank you guys
_________________
Core 2 Quad 9400, Asus PQ5 Pro, Nvidia Geforce GTX 66O
Back to top
View user's profile Send private message
VoidMage
Watchman
Watchman


Joined: 14 Oct 2006
Posts: 6196

PostPosted: Sun May 30, 2010 7:17 pm    Post subject: Reply with quote

Chances are it was a useflag problem.
Back to top
View user's profile Send private message
Quix0r
n00b
n00b


Joined: 06 Sep 2012
Posts: 3
Location: Krefeld

PostPosted: Thu Sep 06, 2012 2:28 pm    Post subject: Reply with quote

Installing dev-python/elementtree didn't help here, too. But I saw this before configuration phase:
Quote:
Disabled modules: gdbm _curses _curses_panel readline _sqlite3 _tkinter _elementtree pyexpat

I ran into this error by installing x11-libs/libxcb-1.8.1:
Code:
Making all in src
make[1]: Entering directory `/var/tmp/portage/x11-libs/libxcb-1.8.1/work/libxcb-1.8.1_build/src'
/usr/bin/python /var/tmp/portage/x11-libs/libxcb-1.8.1/work/libxcb-1.8.1/src/c_client.py -p /usr/lib/python3.2/site-packages /usr/share/xcb/xproto.xml
/usr/bin/python /var/tmp/portage/x11-libs/libxcb-1.8.1/work/libxcb-1.8.1/src/c_client.py -p /usr/lib/python3.2/site-packages /usr/share/xcb/bigreq.xml
Traceback (most recent call last):
  File "/var/tmp/portage/x11-libs/libxcb-1.8.1/work/libxcb-1.8.1/src/c_client.py", line 2, in <module>
    from xml.etree.cElementTree import *
  File "/usr/lib/python3.2/xml/etree/cElementTree.py", line 3, in <module>
    from _elementtree import *
ImportError: No module named _elementtree
make[1]: *** [xproto.c] Error 1
make[1]: *** Waiting for unfinished jobs....
Traceback (most recent call last):
  File "/var/tmp/portage/x11-libs/libxcb-1.8.1/work/libxcb-1.8.1/src/c_client.py", line 2, in <module>
    from xml.etree.cElementTree import *
  File "/usr/lib/python3.2/xml/etree/cElementTree.py", line 3, in <module>
    from _elementtree import *
ImportError: No module named _elementtree
make[1]: *** [bigreq.c] Error 1
make[1]: Leaving directory `/var/tmp/portage/x11-libs/libxcb-1.8.1/work/libxcb-1.8.1_build/src'
make: *** [all-recursive] Error 1

/usr/lib/python3.2/lib-dynload/_elementtree.cpython-32.so is not there

I had to exclude build in my USE variable, now _elementtree.cpython-32.so is being generated.
Back to top
View user's profile Send private message
VoidMage
Watchman
Watchman


Joined: 14 Oct 2006
Posts: 6196

PostPosted: Thu Sep 06, 2012 6:22 pm    Post subject: Reply with quote

:roll: @Quix0r: did you read the description of 'build' useflag ?
Back to top
View user's profile Send private message
Quix0r
n00b
n00b


Joined: 06 Sep 2012
Posts: 3
Location: Krefeld

PostPosted: Sat Sep 22, 2012 7:55 pm    Post subject: Reply with quote

Yes, I really wonder why I added it. 8O :?
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
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