簡體   English   中英

運行 Sphinx 時出現導入錯誤

[英]ImportError when running Sphinx

運行 sphinx 為我的項目生成文檔時出現以下異常。

我在 Github Actions 上運行ubuntu_latest架構 x64。 在我自己的機器(最新版本的 Mac)上運行make html ,我沒有遇到任何問題......

我真的迷路了,所以我很感激任何幫助

Exception occurred:
 File "/home/runner/.local/lib/python3.8/site-packages/prompt_toolkit/filters/app.py",    line 6, in <module>
   from prompt_toolkit.application.current import get_app
   ImportError: cannot import name 'get_app' from partially initialized module 'prompt_toolkit.application.current' (most likely due to a circular import) (/home/runner/.local/lib/python3.8/site-packages/prompt_toolkit/application/current.py)
   The full traceback has been saved in /tmp/sphinx-err-grr15ev2.log, if you want to report the issue to the developers.
   Please also report this if it was a user error, so that a better error message can be provided next time.
   A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!
   make[3]: *** [docs/CMakeFiles/docs.dir/build.make:70: docs/CMakeFiles/docs] Error 2
   make[2]: *** [CMakeFiles/Makefile2:533: docs/CMakeFiles/docs.dir/all] Error 2
   make[1]: *** [CMakeFiles/Makefile2:540: docs/CMakeFiles/docs.dir/rule] Error 2
make: *** [Makefile:280: docs] Error 2

這些是我的文檔的 requirements.txt:

Sphinx>=3
sphinx_rtd_theme
sphinx-autodoc-typehints

GitPython
PyGithub
requests

ipykernel
ipywidgets
nbsphinx
recommonmark

這個問題顯然是已知的,並且也已發布在spatialaudio/nbsphinx#596 中 正如它所說,臨時修復是降級promt-toolkit的版本,該版本必須低於3.0.0

您可以明確降級

pip install -U "prompt-toolkit<3.0.0"

或者簡單地在你的requirements.txt添加一條規則: prompt-toolkit<3.0.0 希望這個不兼容問題能很快得到解決。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM