我已经在Mac上安装了Python 3.4以用于开发目的。所以,当我在我的终端上使用which python
我得到的下面 /usr/bin/python
如何在Mac OS Yosemite上安装Sphinx 1.3b2 for python 3.4
当我做which python3.4
,我得到 /usr/local/bin/python3.4
。
现在我已经安装Sphinx1.3b2并做which sphinx-build
,我得到 /usr/local/bin/sphinx-build
的问题是
我已经安装了很多包Python3.4像elasticsearch,Jinja2的等,这些是不是在Python2.7(我的系统的蟒蛇)
使html始终使用python 2.7和我得到以下错误,当我尝试使我的项目的HTML;
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.
正如你可以看到狮身人面像建造是无法加载蟒蛇3.4包。
任何人都可以帮助我解决这个问题吗?我已经尝试用下面的方法更改sphinx-build文件;
#!/usr/bin/python3.4 and /usr/local/bin/python3.4. none works
道歉格式。我是新来的SO和在提前 – 2015-01-21 11:27:59
有点hurry..Thanks任何帮助的有你叫python3指向您的python3.4一个符号链接?的最佳方式在Mac上处理不同的python版本是使用mac端口或自制软件,甚至只是为狮身人面像创建一个virtualenv – 2015-01-21 14:25:44