- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试使用 sphinx 运行 autodoc。我的项目结构是这样的:
从 input/input.xlsx
读取 python 文件的位置.
我的 conf.py
好像:
import os
import sys
sys.path.insert(0, os.path.abspath('../../'))
extensions = ['sphinx.ext.autodoc']
./docs/sphinx-apidoc -o ./source ../
它创建了一个:
module.rst
My_Project.rst
./docs/source
.
make html
时,它给了我这样的错误:
FileNotFoundError: [Errno 2] No such file or directory: './input'
conf.py
中设置的那样,从逻辑上讲,它应该上升两级,下降一级至
/input
文件夹。
../../input
最佳答案
最后我想出了一些对我有用的东西。事先,我需要澄清一些事情:在位于 ../../
的 python 文件之一中。来自我的 source
目录,代码正在从这个路径读取一个 excel 文件 ./input/input.xlsx
.我发现定义硬编码路径是这个问题的根源。所以我用以下代码修复了它:
directory_path = os.path.dirname(os.path.abspath(__file__))
new_path = os.path.join(directory_path, "input.xlsx")
关于python - FileNotFoundError : [Errno 2] when using sphinx and autodoc,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58848486/
在 Sphinx 2.0.6 中尝试启用通配符 (*) 的搜索时出现以下错误 index products: syntax error, unexpected $undefined near '*'
如果我更新 sphinx.conf 文件中的资源,我可以使用 --rotate 重新索引,一切正常。如果我更新 sphinx.conf 中的索引或添加新索引 --rotate 无效,我必须重新启动 s
问题 我一直在用(Python) Sphinx doc ,以及 CommonMark解析器,编写包含用 reStructuredText 和 Markdown 编写的文件的 Sphinx 文档。到目前
我正在使用漂亮的 sphinx-bootstrap-theme 0.3.4 并尝试将它应用到 Sphinx Python 文档生成器 1.2 版之上。 当我通过 make html 构建文档时,我没有
关于此主题,有几篇“未答复”的帖子与无法找到“sphinx-build”有关: sphinx-build -h command not found in Mac OS Sphinx 是在 OSX 上使
我正在使用 Sphinx 搜索引擎,我遇到一个问题,即一些文件没有显示在搜索结果中,但绝对应该显示。我已经检查以确保没有信息。缺少会阻止这些文件出现的信息。 有什么方法可以直接查询索引,看看有没有这些
如何使用 Sphinx 从索引中获取所有记录?就像 SELECT * FROM index 一样?我知道我可以做这样的事情来获取与特定关键字匹配的所有记录:/usr/local/sphinx/bin/
我对 Sphinx 很陌生,在服务器上记录我的项目。现在一位同事看到了我一直在做的事情,她想做同样的事情——在同一台服务器上记录她的项目。 这些项目不相关(它们不属于单个 TOCtree),我不知道如
我有一个很大的索引定义,索引需要很长时间。我怀疑主要问题是由生成的许多 LEFT OUTER JOIN 引起的。 我看到了 this question ,但找不到有关使用 source: :query
写作的python工具,awscli-bastion , 具有以下由 cookiecutter 构建的目录结构. . ├── awscli_bastion │ ├── __init__.py │
Sphinx 文档生成器提供 only markup .例如,以下将仅包含外部文件“仅”如果其 html 生成器: .. only:: html .. include:: a.rst 但是我将如
我在我的Rails应用程序中实现了 sphinx 搜索。 我想模糊搜索。它应该搜索拼写错误,例如,如果输入搜索查询charact * a * ristics,则应该搜索charact * e * ri
Sphinx-autodoc 将字典、列表和元组扁平化 - 使长的几乎不可读。也并不总是需要 pretty-print 格式,因为一些嵌套的容器比分列更好地保持扁平化。有没有办法显示源代码中输入的可迭
我正在使用 Sphinx 为我的项目编写文档,并且发现下面给出的两个相似的 reStructuredText 段的呈现方式有所不同。 示例 1 Some text: * Item 0 * Item
考虑ReStructuredText中的以下列表: Broken list example ------------------- #. First do spam #. Then do ``eggs
我正在使用 Sphinx Doc 为我的一个项目创建文档,并且我在整个文档中多次使用了一些词,例如 - IP 地址、端口号和许多其他可能会随时间变化的内容。如果由于某种原因,其中一个将被更改,我只想在
我在 .rst 文件中有以下文本: Some text. * Heading | The first topic. | Another topic which is very verbose
我有很多 Sphinx 页面,它们都有相同的链接。像那些: .. _CC-BY: https://creativecommons.org/licenses/by/3.0/ .. _MIT: http:
我想链接到我的狮身人面像文档中的一些URL: blah 我在文档中发现了类似的内容:http://sphinx-doc.org/ext/extlinks.html-而是按照约定用链接替换自定义语法。
使用 sphinx 的自动模块 (https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html) 时, 我只是写在一个 .rst
我是一名优秀的程序员,十分优秀!