Sphinx 编译报错 nonlocal opencitetag

# Sphinx 编译报错 nonlocal open_cite_tag

  • 线上自动编译时出现错误 SyntaxError: invalid syntax
  • 谷歌上搜 nonlocal open_cite_tag 没有任何相关信息
Running Sphinx v1.7.9    
loading translations [zh_CN]... done    
    
Traceback (most recent call last):    
  File "/home/docs/checkouts/readthedocs.org/user_builds/rqalpha/envs/develop/local/lib/python2.7/site-packages/sphinx/cmdline.py", line 303, in main    
    args.warningiserror, args.tags, args.verbosity, args.jobs)    
  File "/home/docs/checkouts/readthedocs.org/user_builds/rqalpha/envs/develop/local/lib/python2.7/site-packages/sphinx/application.py", line 191, in __init__    
    self.setup_extension(extension)    
  File "/home/docs/checkouts/readthedocs.org/user_builds/rqalpha/envs/develop/local/lib/python2.7/site-packages/sphinx/application.py", line 411, in setup_extension    
    self.registry.load_extension(self, extname)    
  File "/home/docs/checkouts/readthedocs.org/user_builds/rqalpha/envs/develop/local/lib/python2.7/site-packages/sphinx/registry.py", line 315, in load_extension    
    mod = __import__(extname, None, None, ['setup'])    
  File "/home/docs/checkouts/readthedocs.org/user_builds/rqalpha/envs/develop/local/lib/python2.7/site-packages/nbsphinx.py", line 1088    
    nonlocal open_cite_tag    
                         ^    
SyntaxError: invalid syntax    
    
Exception occurred:    
  File "/home/docs/checkouts/readthedocs.org/user_builds/rqalpha/envs/develop/local/lib/python2.7/site-packages/sphinx/registry.py", line 315, in load_extension    
    mod = __import__(extname, None, None, ['setup'])    
  File "/home/docs/checkouts/readthedocs.org/user_builds/rqalpha/envs/develop/local/lib/python2.7/site-packages/nbsphinx.py", line 1088    
    nonlocal open_cite_tag    
                         ^    
SyntaxError: invalid syntax    
The full traceback has been saved in /tmp/sphinx-err-cnpEVe.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!    
    
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28

对照后发现 nbsphinx ==0.3.5 时会成功 requirements.txt 文件加上版本限制就 ok

  • cat requirements.txt
Sphinx    
watchdog    
sphinx_rtd_theme    
nbsphinx ==0.3.5    
jupyter_client    
1
2
3
4
5

image.png

上次更新: 2024-01-09 0:01:00
最近更新
01
自建 RSS 订阅
01-05
02
搭建私人 docker hub
01-02
03
关于 SSH 攻击
10-12
更多文章>