[BLFS] libxcb-1.10: ImportError: No module named _elementtree.
Linux From ScratchThis Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
[BLFS] libxcb-1.10: ImportError: No module named _elementtree.
Hi everyone.
I want to install XFCE on my LFS 7.5 system (following the BLFS book's instructions) but there's this error when I'm trying to compile libxcb (which is necessary for XORG):
Quote:
Installation:
Prefix..............: /usr
Making all in src
make[1]: Entering directory '/sources/xc/libxcb-1.10/src'
/usr/bin/python ./c_client.py -p /usr/lib/python2.7/site-packages /usr/share/xcb/xproto.xml
Traceback (most recent call last):
File "./c_client.py", line 2, in <module>
from xml.etree.cElementTree import *
File "/usr/lib/python2.7/xml/etree/cElementTree.py", line 3, in <module>
from _elementtree import *
ImportError: No module named _elementtree
Makefile:1282: recipe for target 'xproto.c' failed
make[1]: *** [xproto.c] Error 1
make[1]: Leaving directory '/sources/xc/libxcb-1.10/src'
Makefile:574: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1
It (obviously) seems to be an error with some Python module... And I can't see where the problem is since I've installed Python 2.7.8 (and libxml2-2.9.1, which is recommended by the book) following the BLFS book's instructions to the letter.
Before you ask: yes, I've already tried with Python 3.4.1 (without "--with-system-expat" option during its installation) and It seemed to work... until there's another python-module error installing MesaLib-10.2.2.
So, basically I'm stuck. Hope you can help me this time!
Libxcb requires libXau, xcb-proto, and libXdmcp, not Python packages.
Xcb-proto requires Python 2 or 3, and I'd advise you to use Python 3 and use expat as it's a recommended package. Even though recommended patches aren't required, they are recommended because they resolve a possible needed co-dependency needed by another package.
I'm running into the same problem...tried both Python 2 & 3, and neither work. Python 3 returns a different error:
Code:
/usr/bin/python ./c_client.py -p /usr/lib/python2.7/site-packages /usr/share/xcb/xproto.xml
Traceback (most recent call last):
File "/usr/lib/python3.4/xml/etree/ElementTree.py", line 1459, in __init__
from xml.parsers import expat
File "/usr/lib/python3.4/xml/parsers/expat.py", line 4, in <module>
from pyexpat import *
ImportError: No module named 'pyexpat'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.4/xml/etree/ElementTree.py", line 1462, in __init__
import pyexpat as expat
ImportError: No module named 'pyexpat'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "./c_client.py", line 3004, in <module>
module = Module(args[0], output)
File "/usr/lib/python2.7/site-packages/xcbgen/state.py", line 64, in __init__
self.namespace = Namespace(filename)
File "/usr/lib/python2.7/site-packages/xcbgen/state.py", line 32, in __init__
self.root = parse(filename).getroot()
File "/usr/lib/python3.4/xml/etree/ElementTree.py", line 1187, in parse
tree.parse(source, parser)
File "/usr/lib/python3.4/xml/etree/ElementTree.py", line 592, in parse
parser = XMLParser()
File "/usr/lib/python3.4/xml/etree/ElementTree.py", line 1465, in __init__
"No module named expat; use SimpleXMLTreeBuilder instead"
ImportError: No module named expat; use SimpleXMLTreeBuilder instead
Makefile:1282: recipe for target 'xproto.c' failed
make[1]: *** [xproto.c] Error 1
make[1]: Leaving directory '/home/salfter/xc/libxcb-1.10/src'
Makefile:574: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1
I built it according to the directions here, and changed the /usr/bin/python symlink to use it.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.