ITStool failed to build

David Evans devans at
Thu Feb 27 07:38:36 PST 2014

On 2/27/14 1:02 AM, Giuseppe Di Matteo wrote:
> Here it is: 
> echo "import libxml2" | /opt/local/bin/python2.7 -
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File
> "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/",
> line 1, in <module>
>     import libxml2mod
> ImportError:
> dlopen(/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/,
> 2): Symbol not found: _PyUnicodeUCS2_AsUTF8String
>   Referenced from:
> /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/
>   Expected in: flat namespace
>  in
> /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/
It appears that you have python27 +ucs4 installed and py27-libxml2 was
built (probably the current binary archive) using the default variant of
python27 (without the +ucs4 variant).

To fix the problem either install the default version of python27

sudo port install python27

Or if you really need to continue to use python27 +ucs4 then you will
need to rebuild py27-libxml2 locally, from source. Note that a fix for a
different problem was committed for py-libxml2 yesterday so be sure to
update your ports first.

sudo port selfupdate
sudo port -ns upgrade --force py27-libxml2

Once this is done, you should be able to build itstool without problems.

You may see this problem with other ports that link against the python
See also

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the macports-users mailing list