# Failed to build libxcb



## davorin (Jun 20, 2012)

*ImportError: No module named _elementtree*

Good evening...

Trying to build x11/libxcb on FreeBSD 9.0 amd64 as it is needed by Cacti, which gives me following error:


```
/usr/local/bin/python2.7 ./c_client.py -p /usr/local/lib/python2.7/site-packages /usr/local/share/xcb/xproto.xml
Traceback (most recent call last):
  File "./c_client.py", line 2, in <module>
    from xml.etree.cElementTree import *
  File "/usr/local/lib/python2.7/xml/etree/cElementTree.py", line 3, in <module>
    from _elementtree import *
ImportError: No module named _elementtree
gmake[1]: *** [xproto.c] Error 1
gmake[1]: Leaving directory `/usr/ports/x11/libxcb/work/libxcb-1.7/src'
```

If I list the modules in Python I see that the corresponding module is listed with a "_failed" in the end:


```
help> modules element

Here is a list of matching modules.  Enter any module name to get more help.

xml.etree.ElementInclude 
xml.etree.ElementPath 
xml.etree.ElementTree 
xml.etree.cElementTree 
_elementtree_failed
```

Any hint on how to resolve this problem?


----------



## davorin (Jun 20, 2012)

Hmm, seems only a [cmd=]pkg_add -r python27[/cmd] solves this. No way of compiling it by sources.


----------



## alie (Jun 21, 2012)

[ Thread merged in -- Mod. ]


```
FreeBSD xxx.xxx.xxx 9.0-STABLE FreeBSD 9.0-STABLE #0: Tue Jun 19 19:28:56 SGT 2012     
xxx@xxx.xxx.xxx:/usr/obj/usr/src/sys/EZYCLIE  amd64
```


```
===>  Building for libxcb-1.7
Making all in src
gmake[1]: Entering directory `/usr/ports/x11/libxcb/work/libxcb-1.7/src'
/usr/local/bin/python2.7 ./c_client.py -p /usr/local/lib/python2.7/site-packages /usr/local/share/xcb/xproto.xml
Traceback (most recent call last):
  File "./c_client.py", line 2, in <module>
    from xml.etree.cElementTree import *
  File "/usr/local/lib/python2.7/xml/etree/cElementTree.py", line 3, in <module>
    from _elementtree import *
ImportError: No module named _elementtree
gmake[1]: *** [xproto.c] Error 1
gmake[1]: Leaving directory `/usr/ports/x11/libxcb/work/libxcb-1.7/src'
gmake: *** [all-recursive] Error 1
*** [do-build] Error code 1

Stop in /usr/ports/x11/libxcb.
```

Anyone facing same issue and got solution to solve the issue above?

Thanks


----------



## SirDice (Jun 21, 2012)

Did x11/xcb-proto install correctly? Try reinstalling it and retry building x11/libxcb.


----------



## SirDice (Jun 21, 2012)

That would indicate lang/python27 didn't install correctly. You could try rebuilding that one too.


----------

