【发布时间】:2019-01-25 19:50:51
【问题描述】:
无法在 gitlab-ci 上设置 sphinx
我正在尝试在 gitlab-ci 上设置和运行 sphnix。它安装在我的本地机器上,服务器工作正常。但不是在 gitlab-ci
这是我的 gitlab-ci 的一部分:
before_script:
- apt-get update -qq && apt-get install -yqq [......] python-pip
- pip install sphinx
# ..........
- bundle exec rake ts:index
- bundle exec rake ts:start
安装sphinx的输出:
$ pip install sphinx
Downloading/unpacking sphinx
[................]
Installing collected packages: sphinx, babel, [.............]
Compiling /tmp/pip-build-V2Tzes/Jinja2/jinja2/asyncfilters.py ...
File "/tmp/pip-build-V2Tzes/Jinja2/jinja2/asyncfilters.py", line 7
async def auto_to_seq(value):
^
SyntaxError: invalid syntax
Compiling /tmp/pip-build-V2Tzes/Jinja2/jinja2/asyncsupport.py ...
File "/tmp/pip-build-V2Tzes/Jinja2/jinja2/asyncsupport.py", line 22
async def concat_async(async_gen):
^
SyntaxError: invalid syntax
Running setup.py install for MarkupSafe
building 'markupsafe._speedups' extension
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c markupsafe/_speedups.c -o build/temp.linux-x86_64-2.7/markupsafe/_speedups.o
markupsafe/_speedups.c:12:20: fatal error: Python.h: No such file or directory
#include <Python.h>
^
compilation terminated.
==========================================================================
WARNING: The C extension could not be compiled, speedups are not enabled.
Failure information, if any, is above.
Retrying the build without the C extension now.
==========================================================================
WARNING: The C extension could not be compiled, speedups are not enabled.
Plain-Python installation succeeded.
==========================================================================
Successfully installed sphinx babel sphinxcontrib-websupport Jinja2 alabaster imagesize Pygments snowballstemmer docutils packaging typing pytz MarkupSafe pyparsing
Cleaning up...
如您所见,成功了。
但是,当它到达这一点时,它会失败:
$ bundle exec rake ts:index
Generating configuration to /builds/my_user/my_ap123/config/test.sphinx.conf
sh: 1: indexer: not found
The Sphinx indexing command failed:
Command: indexer --config "/builds/my_user/my_ap123/config/test.sphinx.conf" --all
Status: 127
Output: See above
这是为什么呢?如何解决?
【问题讨论】:
-
您似乎混淆了两个名为 Sphinx 的工具。
pip install sphinx安装 Sphinx 文档生成器 (sphinx-doc.org)。但我怀疑你真的想安装 Sphinx 搜索引擎 (sphinxsearch.com)。 -
@mzjn,是的。如何安装
Sphinx search engine? -
@mzjn,没错,但我的系统不是 ubuntu 或其他。这是 gitlab-ci。
-
很抱歉,我无法为您提供帮助。我刚刚注意到您尝试安装错误的 Sphinx。
标签: python continuous-integration gitlab sphinx gitlab-ci