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 compatible with Python 3.1+. My OS is Archlinux, a Linux distribution which uses Python 3.2+ as the default Python package.
The installation and configuration is straight forward (easy_install -U Sphinx then sphinx-quickinstall) and I was never asked to choose between the 2.x or 3.x Python interpreter. But when I ask Sphinx to create the documentation of my project, my code is analyzed as if I wrote it for Python 2.x.
Is Sphinx ready for Python 3.x? Did I make a mistake?
I had this exact same problem last night, when I came across your question. — I am also on Arch.
I guess the problem could be a number of different things, but the solution for me was that I had the Python 2 version of the
python-distributepackage installed and therefore hadeasy_install-2.7noteasy_install-3.2.I believe in my case the wrong version of
python-distributewas installed by my attempt to previously install Sphinx from pacman (which installs version 1.0.8), so uninstalling Sphinx and all subsequently unneeded dependenciespacman -Rsu python-sphinxand then installingpython-distributegot me the right version ofeasy_install, then reinstalling Sphinx witheasy_installand the Sphinx installation works as expected.If you have other things that depend onpython-distributethen the process may be a little different. But start by just trying to removepython-distributeand work from there.Scrap that last part. It’s too early in the morning and I wasn’t thinking straight!
python2-distributeandpython-distributeare seperate packages which I believe can co-exist. So, if this is your problem all you need to do is check you havepython-distribute(not “2”), if not install it, and then ensure you useeasy_install-3.2to install Sphinx.Hope this helps you.