LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   [BLFS] libxcb-1.10: ImportError: No module named _elementtree. (https://www.linuxquestions.org/questions/linux-from-scratch-13/%5Bblfs%5D-libxcb-1-10-importerror-no-module-named-_elementtree-4175510248/)

Genny 07-06-2014 12:54 AM

[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. :cry:

So, basically I'm stuck. Hope you can help me this time! :p

Regards from Venezuela (excuse my bad english).

ReaperX7 07-06-2014 04:27 PM

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.

salfter 07-22-2014 11:19 AM

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.

salfter 07-22-2014 02:42 PM

Quote:

Originally Posted by salfter (Post 5207914)
I'm running into the same problem...tried both Python 2 & 3, and neither work.

Trying again after rebuilding expat & python3...so far, so good.

Update: Build succeeded.


All times are GMT -5. The time now is 02:19 AM.