有关windows 64位下sphinx的配置,记录下来,以备自查

从网上下载下来一个开源框架,发现文档目录里,都是.rst格式的文档格式,网上搜索发现有关.rst格式的内容很少,里面有关程序的更少,发现这格式与sphinx有关。sphinx是python的一个工具模块,安装sphinx步骤如下:

1.为了在命令行下,直接运行python命令,实现在命令行下,不用进入 Python 目录即可执行 python.exe,先进行配置环境变量,放在path里面,即“path = C:\Python33;C:\Python33\Scripts”。C:\Python33是我电脑里路径,根据实际电脑路径为准! 

2.安装setuptools 7.0,从https://pypi.python.org/pypi/setuptools#downloads中发现下载ez_setup.py ,然后命令行下运行此文件,或者如果电脑里只有一个python版本的话,直接双击也可运行,推荐第二种,注意:第二方法是python3系列版本才有的!关于ez_setup.py,网上这么说的:

ez_setup.py这是 setuptools 自豪的一种安装方式,只需要一个大约 8K 作为的脚本ez_setup.py,就能自动为用户安装包括 setuptools 自身在内的许多 Python 包。使用这种方式,用户只需要下载 ez_setup.py 并运行,就可以自动下载和安装适合用户当前 Python 版本的适当的 setuptools egg 文件(当然,用户需要 Python 2.3.5 以上的版本,64 位操作系统的用户则需要 Python 2.4 以上的版本)。此外,这段脚本还会将可执行的 easy_install 脚本安装到用户所有的操作系统 Python 可执行脚本正常应该安装的位置(例如,Windows 用户会安装到 Python 安装目录下的 Scripts 目录中)。关于这种安装方法的更详细说明和注意事项,请参考其官方说明。!

安装成功后,会在C:\Python33\Scripts中发现多了一项easy_install-3.3-script.py的文件。

题外话:再记录下用pip安装时,出现的问题,命令行里敲击pip install -U setuptools,然后提示

Requirement already up-to-date: setuptools in c:\python33\lib\site-packages\setuptools-7.0-py3.3.egg
Cleaning up... 

不知道这是种啥情况,有知道的网友请说下

有关PIP的安装,请参考 https://pip.pypa.io/en/latest/installing.html ,关于PIP是干啥的,我也不清楚,不影响sphinx配置,暂且不管它,嘿嘿

3、使用方法

使用方法非常简单,在命令行输入“easy_install 参数”即可。具体为在控制台下命令行输入easy_install sphinx,操作第一次时,命令行里提示:

Searching for sphinx
Reading https://pypi.python.org/simple/sphinx/
Best match: Sphinx 1.3b1
Downloading https://pypi.python.org/packages/source/S/Sphinx/Sphinx-1.3b1.tar.gz#md5=c9be45edbec48f4e4e7cfc53831c2225
error: None 貌似没有成功,继续第二次,须等待个几分钟,根据网络情况而定,命令行里会出现以下内容

C:\Users\Administrator>easy_install sphinx
Searching for sphinx
Reading https://pypi.python.org/simple/sphinx/
Best match: Sphinx 1.3b1
Downloading https://pypi.python.org/packages/source/S/Sphinx/Sphinx-1.3b1.tar.gz#md5=c9be45edbec48f4e4e7cfc53831c2225
Processing Sphinx-1.3b1.tar.gz
Writing c:\users\admini~1\appdata\local\temp\easy_install-unma0f\Sphinx-1.3b1\setup.cfg
Running Sphinx-1.3b1\setup.py -q bdist_egg --dist-dir c:\users\admini~1\appdata\local\temp\easy_install-unma0f\Sphinx-1.
3b1\egg-dist-tmp-404kpy
no previously-included directories found matching 'doc\_build'
Adding sphinx 1.3b1 to easy-install.pth file
Installing sphinx-autogen-script.py script to C:\Python33\Scripts
Installing sphinx-autogen.exe script to C:\Python33\Scripts
Installing sphinx-build-script.py script to C:\Python33\Scripts
Installing sphinx-build.exe script to C:\Python33\Scripts
Installing sphinx-quickstart-script.py script to C:\Python33\Scripts
Installing sphinx-quickstart.exe script to C:\Python33\Scripts
Installing sphinx-apidoc-script.py script to C:\Python33\Scripts
Installing sphinx-apidoc.exe script to C:\Python33\Scripts

Installed c:\python33\lib\site-packages\sphinx-1.3b1-py3.3.egg
Processing dependencies for sphinx
Searching for colorama
Reading https://pypi.python.org/simple/colorama/
Best match: colorama 0.3.2
Downloading https://pypi.python.org/packages/source/c/colorama/colorama-0.3.2.zip#md5=179cc70c4a61901ffd052576b598f11e
Processing colorama-0.3.2.zip
Writing c:\users\admini~1\appdata\local\temp\easy_install-z4n3_0\colorama-0.3.2\setup.cfg
Running colorama-0.3.2\setup.py -q bdist_egg --dist-dir c:\users\admini~1\appdata\local\temp\easy_install-z4n3_0\coloram
a-0.3.2\egg-dist-tmp-7kbdg6
zip_safe flag not set; analyzing archive contents...
Adding colorama 0.3.2 to easy-install.pth file

Installed c:\python33\lib\site-packages\colorama-0.3.2-py3.3.egg
Searching for babel
Reading https://pypi.python.org/simple/babel/
Best match: Babel 1.3
Downloading https://pypi.python.org/packages/source/B/Babel/Babel-1.3.tar.gz#md5=5264ceb02717843cbc9ffce8e6e06bdb
Processing Babel-1.3.tar.gz
Writing c:\users\admini~1\appdata\local\temp\easy_install-klijrk\Babel-1.3\setup.cfg
Running Babel-1.3\setup.py -q bdist_egg --dist-dir c:\users\admini~1\appdata\local\temp\easy_install-klijrk\Babel-1.3\eg
g-dist-tmp-kj56l_
warning: no previously-included files matching '*' found under directory 'docs\_build'
warning: no previously-included files matching '*.pyc' found under directory 'tests'
warning: no previously-included files matching '*.pyo' found under directory 'tests'
Adding babel 1.3 to easy-install.pth file
Installing pybabel-script.py script to C:\Python33\Scripts
Installing pybabel.exe script to C:\Python33\Scripts

Installed c:\python33\lib\site-packages\babel-1.3-py3.3.egg
Searching for snowballstemmer>=1.1
Reading https://pypi.python.org/simple/snowballstemmer/
Best match: snowballstemmer 1.2.0
Downloading https://pypi.python.org/packages/source/s/snowballstemmer/snowballstemmer-1.2.0.tar.gz#md5=51f2ef829db8129dd
0f2354f0b209970
Processing snowballstemmer-1.2.0.tar.gz
Writing c:\users\admini~1\appdata\local\temp\easy_install-wknfvl\snowballstemmer-1.2.0\setup.cfg
Running snowballstemmer-1.2.0\setup.py -q bdist_egg --dist-dir c:\users\admini~1\appdata\local\temp\easy_install-wknfvl\
snowballstemmer-1.2.0\egg-dist-tmp-l6236b
warning: no files found matching '*.py' under directory 'src'
zip_safe flag not set; analyzing archive contents...
Adding snowballstemmer 1.2.0 to easy-install.pth file

Installed c:\python33\lib\site-packages\snowballstemmer-1.2.0-py3.3.egg
Searching for docutils>=0.10
Reading https://pypi.python.org/simple/docutils/
Best match: docutils 0.12
Downloading https://pypi.python.org/packages/source/d/docutils/docutils-0.12.tar.gz#md5=4622263b62c5c771c03502afa3157768

Processing docutils-0.12.tar.gz
Writing c:\users\admini~1\appdata\local\temp\easy_install-c_enqx\docutils-0.12\setup.cfg
Running docutils-0.12\setup.py -q bdist_egg --dist-dir c:\users\admini~1\appdata\local\temp\easy_install-c_enqx\docutils
-0.12\egg-dist-tmp-yuxuf6
warning: no files found matching 'MANIFEST'
warning: no files found matching '*' under directory 'extras'
warning: no previously-included files matching '.cvsignore' found under directory '*'
warning: no previously-included files matching '*.pyc' found under directory '*'
warning: no previously-included files matching '*~' found under directory '*'
warning: no previously-included files matching '.DS_Store' found under directory '*'
copy/convert test suite
zip_safe flag not set; analyzing archive contents...
docutils.parsers.rst.directives.__pycache__.misc.cpython-33: module references __file__
docutils.writers.html4css1.__pycache__.__init__.cpython-33: module references __file__
docutils.writers.latex2e.__pycache__.__init__.cpython-33: module references __file__
docutils.writers.odf_odt.__pycache__.__init__.cpython-33: module references __file__
docutils.writers.pep_html.__pycache__.__init__.cpython-33: module references __file__
docutils.writers.s5_html.__pycache__.__init__.cpython-33: module references __file__
docutils.writers.__pycache__.docutils_xml.cpython-33: module references __path__
Adding docutils 0.12 to easy-install.pth file
Installing rst2html.py script to C:\Python33\Scripts
Installing rst2latex.py script to C:\Python33\Scripts
Installing rst2man.py script to C:\Python33\Scripts
Installing rst2odt.py script to C:\Python33\Scripts
Installing rst2odt_prepstyles.py script to C:\Python33\Scripts
Installing rst2pseudoxml.py script to C:\Python33\Scripts
Installing rst2s5.py script to C:\Python33\Scripts
Installing rst2xetex.py script to C:\Python33\Scripts
Installing rst2xml.py script to C:\Python33\Scripts
Installing rstpep2html.py script to C:\Python33\Scripts

Installed c:\python33\lib\site-packages\docutils-0.12-py3.3.egg
Searching for Pygments>=1.2
Reading https://pypi.python.org/simple/Pygments/
Best match: Pygments 2.0.1
Downloading https://pypi.python.org/packages/source/P/Pygments/Pygments-2.0.1.tar.gz#md5=e0daf4c14a4fe5b630da765904de4d6
c
Processing Pygments-2.0.1.tar.gz
Writing c:\users\admini~1\appdata\local\temp\easy_install-21gbrh\Pygments-2.0.1\setup.cfg
Running Pygments-2.0.1\setup.py -q bdist_egg --dist-dir c:\users\admini~1\appdata\local\temp\easy_install-21gbrh\Pygment
s-2.0.1\egg-dist-tmp-m44clw
Adding pygments 2.0.1 to easy-install.pth file
Installing pygmentize-script.py script to C:\Python33\Scripts
Installing pygmentize.exe script to C:\Python33\Scripts

Installed c:\python33\lib\site-packages\pygments-2.0.1-py3.3.egg
Searching for Jinja2>=2.3
Reading https://pypi.python.org/simple/Jinja2/
Best match: Jinja2 2.7.3
Downloading https://pypi.python.org/packages/source/J/Jinja2/Jinja2-2.7.3.tar.gz#md5=b9dffd2f3b43d673802fe857c8445b1a
Processing Jinja2-2.7.3.tar.gz
Writing c:\users\admini~1\appdata\local\temp\easy_install-t76yf3\Jinja2-2.7.3\setup.cfg
Running Jinja2-2.7.3\setup.py -q bdist_egg --dist-dir c:\users\admini~1\appdata\local\temp\easy_install-t76yf3\Jinja2-2.
7.3\egg-dist-tmp-0oouy9
warning: no files found matching '*' under directory 'custom_fixers'
warning: no previously-included files matching '*' found under directory 'docs\_build'
warning: no previously-included files matching '*.pyc' found under directory 'jinja2'
warning: no previously-included files matching '*.pyc' found under directory 'docs'
warning: no previously-included files matching '*.pyo' found under directory 'jinja2'
warning: no previously-included files matching '*.pyo' found under directory 'docs'
Adding jinja2 2.7.3 to easy-install.pth file

Installed c:\python33\lib\site-packages\jinja2-2.7.3-py3.3.egg
Searching for six>=1.4
Reading https://pypi.python.org/simple/six/
Best match: six 1.8.0
Downloading https://pypi.python.org/packages/source/s/six/six-1.8.0.tar.gz#md5=1626eb24cc889110c38f7e786ec69885
Processing six-1.8.0.tar.gz
Writing c:\users\admini~1\appdata\local\temp\easy_install-xs_11x\six-1.8.0\setup.cfg
Running six-1.8.0\setup.py -q bdist_egg --dist-dir c:\users\admini~1\appdata\local\temp\easy_install-xs_11x\six-1.8.0\eg
g-dist-tmp-btm92u
no previously-included directories found matching 'documentation\_build'
zip_safe flag not set; analyzing archive contents...
__pycache__.six.cpython-33: module references __path__
Adding six 1.8.0 to easy-install.pth file

Installed c:\python33\lib\site-packages\six-1.8.0-py3.3.egg
Searching for pytz>=0a
Reading https://pypi.python.org/simple/pytz/
Best match: pytz 2014.10
Downloading https://pypi.python.org/packages/3.3/p/pytz/pytz-2014.10-py3.3.egg#md5=e03d72ef688816e8ffbd0bbe28f4ad93
Processing pytz-2014.10-py3.3.egg
Moving pytz-2014.10-py3.3.egg to c:\python33\lib\site-packages
Adding pytz 2014.10 to easy-install.pth file

Installed c:\python33\lib\site-packages\pytz-2014.10-py3.3.egg
Searching for markupsafe
Reading https://pypi.python.org/simple/markupsafe/
Best match: MarkupSafe 0.23
Downloading https://pypi.python.org/packages/source/M/MarkupSafe/MarkupSafe-0.23.tar.gz#md5=f5ab3deee4c37cd6a922fb81e730
da6e
Processing MarkupSafe-0.23.tar.gz
Writing c:\users\admini~1\appdata\local\temp\easy_install-17k64l\MarkupSafe-0.23\setup.cfg
Running MarkupSafe-0.23\setup.py -q bdist_egg --dist-dir c:\users\admini~1\appdata\local\temp\easy_install-17k64l\Markup
Safe-0.23\egg-dist-tmp-kicia0
_speedups.c
_speedups.obj : warning LNK4197: 多次指定导出“PyInit__speedups”;使用第一个规范
   正在创建库 build\temp.win-amd64-3.3\Release\markupsafe\_speedups.lib 和对象 build\temp.win-amd64-3.3\Release\markupsa
fe\_speedups.exp
Adding markupsafe 0.23 to easy-install.pth file

Installed c:\python33\lib\site-packages\markupsafe-0.23-py3.3-win-amd64.egg
Finished processing dependencies for sphinx
出现Finished processing dependencies for sphinx,会在 C:\Python33\Scripts里发现如图中的内容
到这里,sphinx的配置已经成功!


二、使用sphinx

使用sphinx的build命令,sphinx builde语法 :

$ sphinx-build [options] sourcedir builddir [filenames]
具体操作:命令行里输入 sphinx-build sourcedir builddir,其中sourcedir即含有 conf.py 文件的路径,builddir是要生成网页的目录。命令行里出现build succeeded这种提示,在目录下就可以看网页的文档了。

参考网址及相关资源:

http://www.ibm.com/developerworks/cn/opensource/os-sphinx-documentation/

http://www.cnblogs.com/Romantic/articles/3586229.html

http://mars914.iteye.com/blog/1870404

http://stackoverflow.com/questions/3652625/installing-setuptools-on-64-bit-windows/3652687#3652687

http://blog.csdn.net/siren0203/article/details/5564082

https://pypi.python.org/pypi/setuptools#windows-simplified

http://blog.csdn.net/boss_t/article/details/14101539

http://blog.csdn.net/boss_t/article/details/14089767  python3的学习资料,这个不错,感谢!

http://www.pythondoc.com/sphinx/invocation.html

https://pip.pypa.io/en/latest/installing.html

http://www.cnblogs.com/yanhuiw/p/3756085.html

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值