Sphinxのインストール¶
Linux¶
Debian/Ubuntu¶
apt-get コマンドで python3-sphinx
(Python 3) か python-sphinx
(Python 2) をインストールしてください:
$ apt-get install python3-sphinx
もしPythonがインストールされていなくても、このコマンドで一緒にインストールされます。
RHEL, CentOS¶
yum コマンドで python-sphinx
をインストールしてください:
$ yum install python-sphinx
もしPythonがインストールされていなくても、このコマンドで一緒にインストールされます。
他のディストリビューション¶
ほとんどのLinuxディストリビューションは、OSのパッケージ管理リポジトリにSphinxが用意されています。一般的なパッケージ名は python3-sphinx
, python-sphinx
, sphinx
のいずれかです。 sphinx
という名前をもつ別の用途のパッケージが他に2つあることに注意してください: 音声認識ツールキット(CMU Sphinx), フルテキスト検索データベース(Sphinx search)。
macOS¶
Homebrew や MacPorts でSphinxをインストールできます。あるいは、Pythonの配布形態の1つである Anaconda でもインストールできます。
MacPorts¶
port コマンドで python36-sphinx
(Python 3) か python27-sphinx
(Python 2) をインストールしてください:
$ sudo port install py36-sphinx
実行パスを設定するために port select
コマンドを使って下さい:
$ sudo port select --set python python36
$ sudo port select --set sphinx py36-sphinx
詳しくは、 package overview を参照してください。
Anaconda¶
$ conda install sphinx
Windows¶
課題
Could we start packaging this?
Most Windows users do not have Python installed by default, so we begin with the installation of Python itself. To check if you already have Python installed, open the Command Prompt (⊞Win-r and type cmd). Once the command prompt is open, type python --version and press Enter. If Python is installed, you will see the version of Python printed to the screen. If you do not have Python installed, refer to the Hitchhikers Guide to Python's Python on Windows installation guides. You must install Python 3.
Once Python is installed, you can install Sphinx using pip. Refer to the pip installation instructions below for more information.
PyPIからインストール¶
Sphinx packages are published on the Python Package Index. The preferred tool for installing packages from PyPI is pip. This tool is provided with all modern versions of Python.
On Linux or MacOS, you should open your terminal and run the following command.
$ pip install -U sphinx
On Windows, you should open Command Prompt (⊞Win-r and type cmd) and run the same command.
C:\> pip install -U sphinx
After installation, type sphinx-build --version on the command prompt. If everything worked fine, you will see the version number for the Sphinx package you just installed.
Installation from PyPI also allows you to install the latest development
release. You will not generally need (or want) to do this, but it can be
useful if you see a possible bug in the latest stable release. To do this, use
the --pre
flag.
$ pip install -U --pre sphinx
ソースからインストール¶
You can install Sphinx directly from a clone of the Git repository. This can be done either by cloning the repo and installing from the local clone, on simply installing directly via git.
$ git clone https://github.com/sphinx-doc/sphinx
$ cd sphinx
$ pip install .
$ pip install git+https://github.com/sphinx-doc/sphinx
You can also download a snapshot of the Git repo in either tar.gz or zip format. Once downloaded and extracted, these can be installed with pip as above.