Sphinx docs make : ImportError: cannot import name normalize

I ran into this simple error that could have consumed my whole day. I have set up sphinx in a conda environment. However, when i try to run `make html` I end up with the following error

CIS2X1NFGTF1:bioflows aragaven$ make html
Traceback (most recent call last):
  File "/Users/aragaven/anaconda2/lib/python2.7/site-packages/Sphinx-1.4.6-py2.7.egg/sphinx/__main__.py", line 14, in <module>
  File "/Users/aragaven/anaconda2/lib/python2.7/site-packages/Sphinx-1.4.6-py2.7.egg/sphinx/__init__.py", line 51, in main
  File "/Users/aragaven/anaconda2/lib/python2.7/site-packages/Sphinx-1.4.6-py2.7.egg/sphinx/__init__.py", line 61, in build_main
    from sphinx import cmdline
  File "/Users/aragaven/anaconda2/lib/python2.7/site-packages/Sphinx-1.4.6-py2.7.egg/sphinx/cmdline.py", line 14, in <module>
    import optparse
  File "/Users/aragaven/anaconda2/lib/python2.7/optparse.py", line 419, in <module>
    _builtin_cvt = { "int" : (_parse_int, _("integer")),
  File "/Users/aragaven/anaconda2/lib/python2.7/gettext.py", line 569, in gettext
    return dgettext(_current_domain, message)
  File "/Users/aragaven/anaconda2/lib/python2.7/gettext.py", line 533, in dgettext
  File "/Users/aragaven/anaconda2/lib/python2.7/gettext.py", line 468, in translation
    mofiles = find(domain, localedir, languages, all=1)
  File "/Users/aragaven/anaconda2/lib/python2.7/gettext.py", line 440, in find
    for nelang in _expand_lang(lang):
  File "/Users/aragaven/anaconda2/lib/python2.7/gettext.py", line 133, in _expand_lang
    from locale import normalize
ImportError: cannot import name normalize
make: *** [html] Error 1

I was puzzled as this had just worked before. Some googling revealed that this could be due to some conflicts in python version. This immediately led me to consider that perhaps there were python version differences in my root environment and another environment i was using for creating some of the documentation. This was indeed the case and once i source activated into the other environment it worked without any errors.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s