Mac OS安装Sphinx遇错:sphinx-quickstart参数过少
sphinx-quickstart on macOS Hey there! I totally get the confusion—tutorials say just run sphinx-quickstart and go, but you're hitting a "too few arguments" error. Let's break down what's going on and fix it.
Why the Error Happens
The key issue here is Sphinx version differences. Older versions of Sphinx (pre-3.0) let you run sphinx-quickstart without any arguments, and it would start an interactive setup right in your current directory. But starting with Sphinx 3.0+, the command requires you to specify a target directory as an argument. Most tutorials out there haven't been updated to reflect this change, hence the mismatch.
How to Fix It
You have two simple options to get the interactive setup working like the tutorials show:
Specify the current directory as the target
If you want to create your docs in the folder you're currently in, just pass.(dot) as the argument:sphinx-quickstart .This will launch the familiar interactive prompt where you can answer questions about your project (like project name, author, etc.)—exactly what the tutorials demonstrate.
Check your Sphinx version (to confirm the cause)
To verify you're running a newer version that requires the directory argument, run:sphinx-build --versionIf the output shows
3.0or higher, the above fix is the right approach.
Bonus Tip
If you ever want to create docs in a new subdirectory (say, docs/), you can pass that path instead:
sphinx-quickstart docs/
Sphinx will create the directory if it doesn't exist, then start the setup process.
Give that a try, and you should be back on track with your Sphinx setup!
内容的提问来源于stack exchange,提问作者unixb0y

