使 HTML 不适用于 windows 10 中的 Sphinx 文档
Make HTML not working for Sphinx documentation in windows 10
我正在尝试遵循 tutorial 关于如何为项目同时设置 sphinx 和 Readthedocs 的内容。我在实习期间使用了 Sphinx,ubuntu 并且设置非常无缝。我刚刚在我的 anaconda power shell 上启动了 sphinx-quickstart
。当我尝试 运行 make html
时出现以下错误:
(base) PS D:\code\RaspberryServer\docs> make html
make : The term 'make' is not recognized as the name of a cmdlet, function, script file, or operable program. Check
the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ make html
+ ~~~~
+ CategoryInfo : ObjectNotFound: (make:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Suggestion [3,General]: The command make was not found, but does exist in the current location. Windows PowerShell does not load commands from the current location by default. If you trust this command, instead type: ".\make". See "get-help about_Command_Precedence" for more details.
一开始我以为是因为我从来没有安装过MinGW。但即使这样做了,我似乎也没有解决问题,而且我不知道如何开始调查它。我的 python 安装完全基于 Anaconda。
Expand the comment above.
sphinx 生成的默认站点假定您在多个操作系统上使用 make html
生成 HTML 页面。
这是通过以下典型假设实现的,
- 您使用的是安装了 (GNU) make 的 macOS 或 Linux,因此
make html
执行 Makefile
中定义的任务。
- 您正处于 Windows 和命令提示符 (
cmd.exe
),因此 make html
实际上调用了 make.bat
。
但是,您正在启动 PowerShell 控制台(“PS D:”表示),因此您无法 make html
正常工作。 PowerShell 不知道如何处理 make
,也不会自动调用 make.bat
。
您可以尝试使用sphinx-build。据我所知,它可以完成工作并且不依赖于您使用的OS。
sphinx-build <sourcedir> <outputdir>
我正在尝试遵循 tutorial 关于如何为项目同时设置 sphinx 和 Readthedocs 的内容。我在实习期间使用了 Sphinx,ubuntu 并且设置非常无缝。我刚刚在我的 anaconda power shell 上启动了 sphinx-quickstart
。当我尝试 运行 make html
时出现以下错误:
(base) PS D:\code\RaspberryServer\docs> make html
make : The term 'make' is not recognized as the name of a cmdlet, function, script file, or operable program. Check
the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ make html
+ ~~~~
+ CategoryInfo : ObjectNotFound: (make:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Suggestion [3,General]: The command make was not found, but does exist in the current location. Windows PowerShell does not load commands from the current location by default. If you trust this command, instead type: ".\make". See "get-help about_Command_Precedence" for more details.
一开始我以为是因为我从来没有安装过MinGW。但即使这样做了,我似乎也没有解决问题,而且我不知道如何开始调查它。我的 python 安装完全基于 Anaconda。
Expand the comment above.
sphinx 生成的默认站点假定您在多个操作系统上使用 make html
生成 HTML 页面。
这是通过以下典型假设实现的,
- 您使用的是安装了 (GNU) make 的 macOS 或 Linux,因此
make html
执行Makefile
中定义的任务。 - 您正处于 Windows 和命令提示符 (
cmd.exe
),因此make html
实际上调用了make.bat
。
但是,您正在启动 PowerShell 控制台(“PS D:”表示),因此您无法 make html
正常工作。 PowerShell 不知道如何处理 make
,也不会自动调用 make.bat
。
您可以尝试使用sphinx-build。据我所知,它可以完成工作并且不依赖于您使用的OS。
sphinx-build <sourcedir> <outputdir>