我正在尝试安装额外的 cmake 模块从源代码,然后执行命令后出现错误 make
:
Extension error:
Could not import extension ecm (exception: No module named 'sphinxcontrib')
make[2]: *** [docs/CMakeFiles/documentation.dir/build.make:62: docs/doc_format_html] Error 2
make[2]: Leaving directory '/home/masterpi/Documents/Extra-CMake-Modules/extra-cmake-modules/build'
make[1]: *** [CMakeFiles/Makefile2:217: docs/CMakeFiles/documentation.dir/all] Error 2
make[1]: Leaving directory '/home/masterpi/Documents/Extra-CMake-Modules/extra-cmake-modules/build'
make: *** [Makefile:163: all] Error 2
看来问题出在 Sphinx 模块上,但我尝试卸载并重新安装它,pip
但仍然出现错误。那么我能做些什么来修复它呢?以下是我执行命令时的cmake -DCMAKE_INSTALL_PREFIX=/usr ..
日志make
:
$ cmake -DCMAKE_INSTALL_PREFIX=/usr ..
-- WARNING: skipping tests that require PyQt
-- The following features have been enabled:
* BUILD_HTML_DOCS, Generate HTML documentation for installed modules.
* BUILD_MAN_DOCS, Generate man page documentation for installed modules.
* BUILD_TESTING, Build automated tests.
-- The following OPTIONAL packages have been found:
* Sphinx (required version >= 1.2), Tool to generate documentation., <https://www.sphinx-doc.org/>
Required to build documentation for Extra CMake Modules.
* QCollectionGenerator, Qt help collection generator., <https://www.qt.io/>
Required to build Extra CMake Modules documentation in Qt Help format.
* Qt5LinguistTools, Qt5 linguist tools., <https://www.qt.io/>
Required to run tests for the ECMPoQmTools module.
* Qt5Core, Qt5 core library., <https://www.qt.io/>
Required to run tests for the ECMQtDeclareLoggingCategory module, and for some tests of the KDEInstallDirs module.
* Qt5Network (required version >= 5.14.2)
* Qt5Qml (required version >= 5.14.2)
* Qt5QmlModels (required version >= 5.14.2)
* Qt5Gui (required version >= 5.14.2)
* Qt5Quick, Qt5 Quick library., <https://www.qt.io/>
Required to run tests for the ECMQMLModules module.
-- The following features have been disabled:
* BUILD_QTHELP_DOCS, Generate QtHelp documentation for installed modules.
-- Configuring done
-- Generating done
-- Build files have been written to: /home/masterpi/Documents/Extra-CMake-Modules/extra-cmake-modules/build
$ make
make[1]: Entering directory '/home/masterpi/Documents/Extra-CMake-Modules/extra-cmake-modules/build'
make[2]: Entering directory '/home/masterpi/Documents/Extra-CMake-Modules/extra-cmake-modules/build'
make[2]: Leaving directory '/home/masterpi/Documents/Extra-CMake-Modules/extra-cmake-modules/build'
make[2]: Entering directory '/home/masterpi/Documents/Extra-CMake-Modules/extra-cmake-modules/build'
[ 50%] sphinx-build html: see /home/masterpi/Documents/Extra-CMake-Modules/extra-cmake-modules/build/docs/build-html.log
/usr/lib/python3.8/importlib/__init__.py:127: RemovedInSphinx40Warning: The alias 'sphinx.util.pycompat.htmlescape' is deprecated, use 'html.escape' instead. Check CHANGES for Sphinx API modifications.
return _bootstrap._gcd_import(name[level:], package, level)
Extension error:
Could not import extension ecm (exception: No module named 'sphinxcontrib')
make[2]: *** [docs/CMakeFiles/documentation.dir/build.make:62: docs/doc_format_html] Error 2
make[2]: Leaving directory '/home/masterpi/Documents/Extra-CMake-Modules/extra-cmake-modules/build'
make[1]: *** [CMakeFiles/Makefile2:217: docs/CMakeFiles/documentation.dir/all] Error 2
make[1]: Leaving directory '/home/masterpi/Documents/Extra-CMake-Modules/extra-cmake-modules/build'
make: *** [Makefile:163: all] Error 2
答案1
以防万一其他人偶然发现此错误,以下是有关 KDE 基础结构的后续讨论: http://kde.6490.n7.nabble.com/Error-when-trying-to-install-ECM-Extra-Cmake-Modules-td1752955.html
解决方案:安装python3-sphinxcontrib*
软件包(即通过pip3 install python3-sphinxcontrib
或通过您的软件包管理器)。
对我来说,专门安装就足够了python3-sphinxcontrib.qthelp
。