How to force Sphinx to use Python 3.x interpreter

后端 未结 9 922
遇见更好的自我
遇见更好的自我 2020-12-05 14:56

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

9条回答
  •  盖世英雄少女心
    2020-12-05 15:09

    It seems that Sphinx is installed only with Python-2 support. Although there are various ways to install Sphinx for python3, just use virtualenv to create a custom environment that uses python3 by default.

    virtualenv -p /path/to/python-3 foo

    And inside the virtualenv install Sphinx:

    pip install Sphinx

    As a bonus, this approach allows you to create custom environments for different projects.

    PS. You might want to consider using virtualenvwrapper.

提交回复
热议问题