Search code examples
pythonpython-2.7buildns-3

Error while building ns-3


I am trying to install ns-3 by tarball but when I try to build with following command

./build.py --enable-examples --enable-tests

as given in manual I get following error:

Traceback (most recent call last):
  File "./build.py", line 170, in <module>
    sys.exit(main(sys.argv))
  File "./build.py", line 111, in main
    config = dom.parse(dot_config)
  File "/usr/local/lib/python2.7/xml/dom/minidom.py", line 1917, in parse
    from xml.dom import expatbuilder
  File "/usr/local/lib/python2.7/xml/dom/expatbuilder.py", line 32, in <module>
    from xml.parsers import expat
  File "/usr/local/lib/python2.7/xml/parsers/expat.py", line 4, in <module>
    from pyexpat import *
ImportError: /usr/local/lib/python2.7/lib-dynload/pyexpat.so: undefined symbol: PyUnicodeUCS2_DecodeUTF

I know this error is related to python but not able to resolve after doing a lot of Google search.Can anybody help me how to proceed further?


Solution

  • Solved:

    After exhausted research I found Python for Linux default setting is UCS2. I rebuilt Python from source using

     ./configure --enable-unicode=ucs4 
    

    to force compile using UCS4. Here is the link.