I try to create documentation for a project written with Python 3.x. Sphinx is the tool I want to use and, according to the official site, its last version 1.1.2 is
When I searched for an answer, this is the site that came up over and over. I'm thinking the answer is not easy to find because everyone else understands sphinx better than I can figure out. But if any is still searching for an answer, this is what eventually I ended up with:
sudo apt-get update
sudo apt-get install python3
sudo apt-get install sqlite3
sudo apt-get install idle3
sudo apt-get install python3-pip
sudo apt-get install python3-docutils
sudo apt-get install python3-jinja2
sudo apt-get install python3-pygments
sudo pip3 install Sphinx
The key was I was missing the fact that there was a pip3. I also update the system before adding a package as habit.
I'm on Ubunut and had the same problem. I won't use Josh_P or Nicolas answer because..
So i fixed it with this little script called sphinx3-build
:
#!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
Same as /usr/bin/sphinx-build but with different
interpreter
"""
import sys
if __name__ == '__main__':
from sphinx import main, make_main
if sys.argv[1:2] == ['-M']:
sys.exit(make_main(sys.argv))
else:
sys.exit(main(sys.argv))
It's the same as sphinx-build but with a different interpreter. In the Makefile I changed the following line:
SPHINXBUILD = sphinx3-build
Now copy the file to the /usr/bin/
folder:
sudo cp sphinx3-build /usr/bin/
This worked for me. You could also use it locally for one project only by placing the
script into the same folder as the Makefile and set SPHINXBUILD
to
./sphinx3-build
.
I think Sphinx simply uses the "python" command as interpreter. But according to the Makefile, you can specify your own with the PYTHON option, when running make
for installation.