4

I have followed following guide.

$ pip install sphinx sphinx-autobuild
$ pip freeze | grep "sphinx"
sphinx-autobuild==0.6.0
sphinxcontrib-websupport==1.0.0

$ cd docs
$ sphinx-quickstart
$ make html

make html gives following error:

/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: No module named sphinx
make: *** [help] Error 1

[Q] How could I prevent this error from happening?

Thank you for your valuable time and help.

2 Answers 2

5

I had the same issue, and I thought it might be helpful to share the solution I found.

Open the Makefile file, and change the following line:

SPHINXBUILD = python -msphinx

To this one:

SPHINXBUILD = python3 -msphinx

Sign up to request clarification or add additional context in comments.

2 Comments

Where is the makefile file located (on a Mac)?
Found it myself in the Sphinx doc Project Folder
1

First, don't install anything into your system's Python. Use either a virtual environment or your system's user installs to isolate packages from the system Python. The Python Packaging Authority provides an explanation of why virtual environments are a good idea™.

I prefer to start by installing another version of Python on my system, either using the official installers for macOS (beginner) or pyenv (not beginner). Install Python 3.x unless you absolutely must use Python 2.

Next install or upgrade your Python's packaging tools. This is one of the very rare times that I install or upgrade packages in my Pythons, although you may want to do so for your user.

Next create and use a virtual environment.

Finally follow the correct guide to install Sphinx into your virtual environment and get started using Sphinx.

1 Comment

That final link is broken - is there an updated one?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.