Sphinx 在 Linux Centos 中显示旧版本

Sphinx showing old build version in Linux Centos

我在我的 Centos 机器上安装了 sphinx,它显示它已经安装了最新的 sphinx 版本,即 4.3.0,但是 运行“sphinx-quickstart”或检查“sphinx-build --version” , 它显示版本 1.1.3.

它显示版本不匹配。 请告诉我如何解决这个问题并消除版本不匹配。

日志-

[<...> docs]$  sphinx-build --version
Sphinx v1.1.3

[<...> docs]$  pip show sphinx
Name: Sphinx
Version: 4.3.1
Summary: Python documentation generator
Home-page: https://www.sphinx-doc.org/
Author: Georg Brandl
Author-email: georg@python.org
License: BSD
Location: </.../>.local/lib/python3.6/site-packages
Requires: alabaster, babel, docutils, imagesize, Jinja2, packaging, Pygments, requests, setuptools, snowballstemmer, sphinxcontrib-applehelp, sphinxcontrib-devhelp, sphinxcontrib-htmlhelp, sphinxcontrib-jsmath, sphinxcontrib-qthelp, sphinxcontrib-serializinghtml


[<...> docs]$ sphinx-quickstart
Welcome to the Sphinx 1.1.3 quickstart utility.

我有另一台 Linux 我之前安装了 sphinx 的机器,它显示了正确的 sphinx 版本和构建版本。

日志-

[<...> docs]$  pip show sphinx

Name: Sphinx
Version: 4.2.0
Summary: Python documentation generator
Home-page: https://www.sphinx-doc.org/
Author: Georg Brandl
Author-email: georg@python.org
License: BSD
Location: <...>/.local/lib/python3.6/site-packages
Requires: sphinxcontrib-jsmath, sphinxcontrib-htmlhelp, requests, babel, packaging, sphinxcontrib-serializinghtml, sphinxcontrib-qthelp, Jinja2, Pygments, snowballstemmer, alabaster, docutils, setuptools, sphinxcontrib-applehelp, imagesize, sphinxcontrib-devhelp
Required-by: sphinxcontrib-confluencebuilder, rinohtype, recommonmark

[<...> docs]$ sphinx-build --version
sphinx-build 4.2.0

删除 python-sphinx 后问题得到解决,版本 1.1.3 已删除,sphinx 在最新版本的 4.3.1 上运行良好。

日志-

[<...> ~]$ sudo yum remove python-sphinx
Loaded plugins: fastestmirror
Resolving Dependencies
--> Running transaction check
---> Package python-sphinx.noarch 0:1.1.3-11.el7 will be erased
--> Finished Dependency Resolution

Dependencies Resolved

========================================================================================================================================================================
 Package                                     Arch                                 Version                                     Repository                           Size
========================================================================================================================================================================
Removing:
 python-sphinx                               noarch                               1.1.3-11.el7                                @base                               3.5 M

Transaction Summary
========================================================================================================================================================================
Remove  1 Package

Installed size: 3.5 M
Is this ok [y/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Erasing    : python-sphinx-1.1.3-11.el7.noarch                                                                                                                    1/1
  Verifying  : python-sphinx-1.1.3-11.el7.noarch                                                                                                                    1/1

Removed:
  python-sphinx.noarch 0:1.1.3-11.el7

Complete!

[<...> docs]$ sphinx-build --version
-bash: /usr/bin/sphinx-build: No such file or directory


[<...> ~]$ pip show sphinx
Name: Sphinx
Version: 4.3.1

帖子帮助解决了这个问题。 Sphinx working on python 3 interpreter