问题
I am using PyCharm as my IDE to create my python application. As I understand it has a build in documentation feature based on two different programs where one of them is Sphinx.
I am trying to set up my folders but I find that either the documentation in how this is done is lacking or there is something basic I've missed.
My project folder structure is the following
app/ - for my main application
plugins/plugin_names/version_id/ - Folder for plugins to main application can use
sphinx/doc/ - setup folder for sphinx generated by quick start.
Now when I try to run this through PyCarm. Setting up a run configuration pointing it input to spinx/doc/source and output to sphinx/doc/build.
when I execute this configuration I get the following error
Traceback (most recent call last):
File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 4.5.3\helpers\rest_runners\sphinx_runner.py", line 5, in <module>
from sphinx import cmdline
File "C:\python34\lib\site-packages\sphinx\cmdline.py", line 23, in <module>
from sphinx.application import Sphinx
File "C:\python34\lib\site-packages\sphinx\application.py", line 37, in <module>
from sphinx.builders import BUILTIN_BUILDERS
File "C:\python34\lib\site-packages\sphinx\builders\__init__.py", line 23, in <module>
from sphinx.util import i18n, path_stabilize
File "C:\python34\lib\site-packages\sphinx\util\i18n.py", line 15, in <module>
from babel.messages.pofile import read_po
File "C:\python34\lib\site-packages\babel\messages\__init__.py", line 12, in <module>
from babel.messages.catalog import *
File "C:\python34\lib\site-packages\babel\messages\catalog.py", line 23, in <module>
from babel.dates import format_datetime
File "C:\python34\lib\site-packages\babel\dates.py", line 28, in <module>
from babel.util import UTC, LOCALTZ
File "C:\python34\lib\site-packages\babel\util.py", line 278, in <module>
from babel import localtime
File "C:\python34\lib\site-packages\babel\localtime\__init__.py", line 21, in <module>
from babel.localtime._win32 import _get_localzone
File "C:\python34\lib\site-packages\babel\localtime\_win32.py", line 18, in <module>
tz_names = get_global('windows_zone_mapping')
File "C:\python34\lib\site-packages\babel\core.py", line 58, in get_global
_global_data = pickle.load(fileobj)
TypeError: an integer is required (got type str)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 4.5.3\helpers\rest_runners\sphinx_runner.py", line 7, in <module>
raise NameError("Cannot find sphinx in selected interpreter.")
NameError: Cannot find sphinx in selected interpreter.
Process finished with exit code 1
I do not know why it has to be so complicated all i want is a program to take an input file and generate and output html.
Regards
回答1:
Reason was due to bable version 2.0. downgrading to bable version 1.3 solved the problem
来源:https://stackoverflow.com/questions/32624461/new-to-sphinx-in-pycharm