почему rst2pdf выдает ошибку TemplateNotFound, когда шаблон существует? - PullRequest
0 голосов
/ 02 мая 2019

Я использую библиотеку rst2pdf для генерации PDF-документа через Sphinx.Однако, когда я пытаюсь сделать это, я получаю следующую ошибку:

[exec] sphinx-build -b pdf -d stage/doctrees   source/welcome stage/pdf
     [exec] Running Sphinx v1.8.5
     [exec] ['support/style']
     [exec] loading pickled environment... done
     [exec] building [mo]: targets for 0 po files that are out of date
     [exec] building [pdf]: targets for 4 source files that are out of date
     [exec] updating environment: 0 added, 0 changed, 0 removed
     [exec] looking for now-outdated files... none found
     [exec] processing WelcomeToRealtimeDespatch... 
     [exec] index 
     [exec] 01-introduction 
     [exec] 03-market 
     [exec] 05-administration 
     [exec] resolving references...
     [exec] done
     [exec] writing WelcomeToRealtimeDespatch... 
     [exec] FAILED
     [exec] build succeeded.
     [exec] 
     [exec] Build finished. The PDF files are in stage/pdf.
     [exec] /usr/local/lib/python2.7/dist-packages/rst2pdf/pdfbuilder.py:207: RemovedInSphinx20Warning: env.create_index() is deprecated. Use sphinx.environment.adapters.indexentreis.IndexEntries instead.
     [exec]   genindex = self.env.create_index(self)
     [exec] [ERROR] pdfbuilder.py:133 /home/catherine/workspace/rtd2/documentation/source/welcome/../../support/style/apicover.tmpl
     [exec] Traceback (most recent call last):
     [exec]   File "/usr/local/lib/python2.7/dist-packages/rst2pdf/pdfbuilder.py", line 130, in write
     [exec]     docwriter.write(doctree, destination)
     [exec]   File "/usr/local/lib/python2.7/dist-packages/docutils/writers/__init__.py", line 80, in write
     [exec]     self.translate()
     [exec]   File "/usr/local/lib/python2.7/dist-packages/rst2pdf/pdfbuilder.py", line 600, in translate
     [exec]     date=date
     [exec]   File "/usr/local/lib/python2.7/dist-packages/rst2pdf/createpdf.py", line 112, in renderTemplate
     [exec]     template =jinja_env.get_template(tname)
     [exec]   File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 830, in get_template
     [exec]     return self._load_template(name, self.make_globals(globals))
     [exec]   File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 804, in _load_template
     [exec]     template = self.loader.load(self, name, globals)
     [exec]   File "/usr/local/lib/python2.7/dist-packages/jinja2/loaders.py", line 113, in load
     [exec]     source, filename, uptodate = self.get_source(environment, name)
     [exec]   File "/usr/local/lib/python2.7/dist-packages/jinja2/loaders.py", line 168, in get_source
     [exec]     pieces = split_template_path(template)
     [exec]   File "/usr/local/lib/python2.7/dist-packages/jinja2/loaders.py", line 31, in split_template_path
     [exec]     raise TemplateNotFound(template)
     [exec] TemplateNotFound: /home/catherine/workspace/rtd2/documentation/source/welcome/../../support/style/apicover.tmpl

Я могу подтвердить, что шаблон находится по пути:

ls -l /home/catherine/workspace/rtd2/documentation/source/welcome/../../support/style/apicover.tmpl
-rwxrwxrwx 1 catherine catherine 436 Feb 14  2018 /home/catherine/workspace/rtd2/documentation/source/welcome/../../support/style/apicover.tmpl

Любые идеи, почему pdfbuilder не можетбыть в состоянии найти предоставленный шаблон?

...