Sphinx error

515 views
Skip to first unread message

Bill Bedford

unread,
Aug 30, 2015, 5:39:57 AM8/30/15
to sphinx...@googlegroups.com
I've just upgraded Sphinx to 1.3.1 and now I get the following error
when I run make:

York:Mousa Bill$ make html
sphinx-build -b html -d _build/doctrees . _build/html
Traceback (most recent call last):
File
"/Library/Frameworks/Python.framework/Versions/3.4/bin/sphinx-build",
line 11, in <module>
sys.exit(main())
File
"/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/sphinx/__init__.py",
line 51, in main
sys.exit(build_main(argv))
File
"/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/sphinx/__init__.py",
line 61, in build_main
from sphinx import cmdline
File
"/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/sphinx/cmdline.py",
line 14, in <module>
import optparse
File
"/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/optparse.py",
line 421, in <module>
_builtin_cvt = { "int" : (_parse_int, _("integer")),
File
"/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/gettext.py",
line 498, in gettext
return dgettext(_current_domain, message)
File
"/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/gettext.py",
line 462, in dgettext
codeset=_localecodesets.get(domain))
File
"/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/gettext.py",
line 397, in translation
mofiles = find(domain, localedir, languages, all=True)
File
"/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/gettext.py",
line 369, in find
for nelang in _expand_lang(lang):
File
"/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/gettext.py",
line 112, in _expand_lang
loc = locale.normalize(loc)
AttributeError: 'module' object has no attribute 'normalize'
make: *** [html] Error 1

I get similar errors when I other scripts e.g. virtualenv

Can anyone tell be what is going one and how I can fix it?



--
Bill Bedford

"Man is an animal suspended in webs of significance he himself has spun"


-- Clifford Geertz

Takayuki Shimizukawa

unread,
Aug 30, 2015, 6:21:36 AM8/30/15
to sphinx...@googlegroups.com
Hi,

2015年8月30日(日) 18:39 Bill Bedford <bi...@mousa.biz>:
  File
"/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/gettext.py",
line 112, in _expand_lang
    loc = locale.normalize(loc)
AttributeError: 'module' object has no attribute 'normalize'
make: *** [html] Error 1

I guess your Python-3.4 environment has another 'locale' module instead of python standard.
To check it, please run bellow code in your Python-3.4 interactive shell.:

>>> import locale
>>> print(locale.__file__)

If it indicate a path that is not a python standard library, it's a cause of your error.

Regards,
--
Takayuki SHIMIZUKAWA

Bill Bedford

unread,
Aug 30, 2015, 6:40:41 AM8/30/15
to sphinx...@googlegroups.com
On Sun, 30 Aug 2015 10:21:23 +0000, Takayuki Shimizukawa wrote:
Hi,

> I guess your Python-3.4 environment has another 'locale' module instead of
> python standard.
> To check it, please run bellow code in your Python-3.4 interactive shell.:
>
>>>> import locale
>>>> print(locale.__file__)
>
> If it indicate a path that is not a python standard library, it's a cause
> of your error.
>

OK this is what I get:

>>> print(locale.__file__)
/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/Sphinx/locale/__init__.py


So will Sphinx work as expected if I delete Sphinx/locale ?

Takayuki Shimizukawa

unread,
Aug 31, 2015, 4:21:42 AM8/31/15
to sphinx...@googlegroups.com
2015年8月30日(日) 19:40 Bill Bedford <bi...@mousa.biz>:
On Sun, 30 Aug 2015 10:21:23 +0000, Takayuki Shimizukawa wrote:
Hi,

> I guess your Python-3.4 environment has another 'locale' module instead of
> python standard.
> To check it, please run bellow code in your Python-3.4 interactive shell.:
>
>>>> import locale
>>>> print(locale.__file__)
>
> If it indicate a path that is not a python standard library, it's a cause
> of your error.
>

OK this is what I get:

>>> print(locale.__file__)
/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/Sphinx/locale/__init__.py

Strange...
 
So will Sphinx work as expected if I delete Sphinx/locale ?

NO.
I guess your python environment has path to
/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/Sphinx/
This path might be included in sys.path:
$ python
>>> import sys
>>> print(sys.path)
*** list of path will be printed here ***

If it's true, you must remove the path that is pointing to Sphinx directory.

BTW, why does your `Sphinx` directory name is capitalized?
How do you install Sphinx?

--
Takayuki Shimizukawa

Bill Bedford

unread,
Aug 31, 2015, 6:09:05 AM8/31/15
to sphinx...@googlegroups.com
On Mon, 31 Aug 2015 08:21:30 +0000, Takayuki Shimizukawa wrote:
> 2015年8月30日(日) 19:40 Bill Bedford <bi...@mousa.biz>:

> I guess your python environment has path to
>
/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/Sphinx/
> This path might be included in sys.path:
> $ python
>>>> import sys
>>>> print(sys.path)
> *** list of path will be printed here ***
>
> If it's true, you must remove the path that is pointing to Sphinx directory.
>
> BTW, why does your `Sphinx` directory name is capitalized?
> How do you install Sphinx?

There was a './Sphinx' entry in a 'easy-install.pth' file. Now that has
been removed sphinx is working as it should

Thanks for your help

Takayuki Shimizukawa

unread,
Aug 31, 2015, 6:33:46 AM8/31/15
to sphinx...@googlegroups.com
2015年8月31日(月) 19:08 Bill Bedford <bi...@mousa.biz>:
> If it's true, you must remove the path that is pointing to Sphinx directory.
>
> BTW, why does your `Sphinx` directory name is capitalized?
> How do you install Sphinx?

There was a './Sphinx' entry in a 'easy-install.pth' file. Now that has
been removed sphinx is working as it should

Thanks for your help

Sounds good :)
I guess you are using easy_install.
I suggest you should use `pip` instead of easy_install if you can.

note: using easy_install and pip at the same time is dangerous, in some case. Please take care.
Reply all
Reply to author
Forward
0 new messages