如何解决使 HTML 不适用于 Windows 10 中的 Sphinx 文档
我正在尝试遵循关于如何将 sphinx 和 Readthedocs 设置为项目的tutorial。那天我在实习时使用了 Sphinx,使用 ubuntu 并且设置非常无缝。我刚刚在我的 anaconda 电源外壳上启动了 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。
解决方法
展开上面的评论。
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
。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。