Reputation: 11
I have installed Python 3.4 on Mac for developmental purposes. So when I use which python
on my terminal I get the below
/usr/bin/python
And when I do which python3.4
, I get
/usr/local/bin/python3.4
.
Now I have installed Sphinx1.3b2 and on doing which sphinx-build
, i get
/usr/local/bin/sphinx-build
The problems are
I have installed many packages for Python3.4 like elasticsearch, Jinja2 etc. which are not in Python2.7 (my system's python)
Make html always uses python 2.7 and I get the following error when i try to make the html for my project;
sphinx-build -b html -d _build/doctrees . _build/html
Running Sphinx v1.3b2
making output directory...
loading pickled environment... not yet created
loading intersphinx inventory from http://docs.python.org /objects.inv...
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 3 source files that are out of date
updating environment: 3 added, 0 changed, 0 removed
reading sources... [100%] index
/Users/sourav/Catalobo/catalobo-webapp/SphinxDocs/Code.rst:4: WARNING: autodoc: failed to import module u'catalobo'; the following exception was raised:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/Sphinx-1.3b2-py2.7.egg/sphinx/ext/autodoc.py", line 378, in import_object
__import__(self.modname)
File "/Users/sourav/Catalobo/catalobo-webapp/SphinxDocs/catalobo.py", line 4, in <module>
from elasticsearch import Elasticsearch
ImportError: No module named elasticsearch
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
writing output... [100%] index
generating indices... genindex
writing additional pages... search
copying static files... done
copying extra files... done
dumping search index in English (code: en) ... done
dumping object inventory... done
build succeeded, 1 warning.
Build finished. The HTML pages are in _build/html.
As you can see the sphinx-build is not able to load the python 3.4 packages.
Can anyone help me in resolving this?
FYI, I have already tried changing the sphinx-build file with the below;
#!/usr/bin/python3.4 and /usr/local/bin/python3.4. none works
Upvotes: 0
Views: 630
Reputation: 11
Here is how I resolved it;
which sphinx-build
/usr/local/bin/sphinx-build
Now did a vim /usr/local/bin/sphinx-build (or use any text editor) and the below is what I changed. It was earlier Sphinx==1.3b2 and python2.7
Changed the Sphinx==1.3b2 to 1.2.3 (the installed version of the Sphinx (this was installed usin brew.) Changed the python to python3.4
#!/usr/local/bin/python3.4
# EASY-INSTALL-ENTRY-SCRIPT: 'Sphinx==1.3b2','console_scripts','sphinx-build'
__requires__ = 'Sphinx==1.2.3'
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.exit(
load_entry_point('Sphinx==1.2.3', 'console_scripts', 'sphinx-build')()
)
Upvotes: 0