我正在尝试使用 Sphinx 来记录我一直在开发的 Python 库。我一直在使用this post作为一路上的粗略指南。但是,我在让 Sphinx 正常工作时遇到问题。
一切设置完毕后,Sphinx 就已安装,并且我已将文档添加到从项目根目录输入的代码中:
sphinx-apidoc -F -o docs/ mypackage/
输出:
Creating file docs/mypackage.rst.
Creating file docs/mypackage.helpers.rst.
Creating file docs/conf.py.
Creating file docs/index.rst.
Creating file docs/Makefile.
Creating file docs/make.bat.
接下来,我分别编辑 docs/conf.py,确保我的 sys.path.insert(0, os.path.abspath('/Users//path/to/mypackage')) 正确。
但是,当我尝试通过以下方式构建文档(从文档目录中):
build html
我受到的欢迎是:
-bash: make: command not found
我使用过 sphinx-apidoc 并使用其他库制作了 html,但从未遇到过这个问题,所以我有点不知所措。有什么想法吗?
最佳答案
正如@Blender 在评论中所述。未安装 make
。我最近不得不重新安装 Xcode,却忘记重新安装命令行工具。
为了澄清,我正在运行 OSX 10.8.5。
要使用make
,首先通过应用商店
安装Xcode
,然后打开Xcode并下载/安装命令行工具
导航至:Xcode->Preferences->Downloads
关于python - sphinx-apidoc -F -o <输出目录> <项目目录> 无法创建 make 文件 :,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20809950/