问题
I'm trying to follow the tutorial about how to set sphinx and Readthedocs together for project. I used Sphinx back in the day while in a internship, with ubuntu and the setup was quite seamless. I've just launched the sphinx-quickstart
on my anaconda power shell. When I try to run make html
the following error appears:
(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.
Firstly I thought it was because I had never installed MinGW. But even after doing so I don't seem to fix the problem and I have no clue to how to start looking into it. My python installation is fully based on Anaconda.
回答1:
Expand the comment above.
The default site generated by sphinx assumes you use make html
on multiple operating systems to generate HTML pages.
That's achieved by typical assumption that,
- You are on macOS or Linux with (GNU) make installed, so
make html
executes the task defined inMakefile
. - You are on Windows and at command prompt (
cmd.exe
), somake html
actually calls tomake.bat
.
However, you are launching PowerShell console ("PS D:" indicates that), so you cannot get make html
working properly. PowerShell does not know what to do with make
, and won't call make.bat
automatically.
来源:https://stackoverflow.com/questions/65471557/make-html-not-working-for-sphinx-documentation-in-windows-10