Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/296.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python jupyter_sphinx:linenos:选项没有任何效果_Python_Jupyter_Python Sphinx - Fatal编程技术网

Python jupyter_sphinx:linenos:选项没有任何效果

Python jupyter_sphinx:linenos:选项没有任何效果,python,jupyter,python-sphinx,Python,Jupyter,Python Sphinx,以下是一个简单的配方: 通过Sphinx quickstart在空根目录中创建最简单的Sphinx项目 让一切都处于默认状态 将“jupyter_sphinx”添加到conf.py中的扩展列表中 根据扩展的文档,向index.rst添加一个简单的Python代码块: 在根目录下创建html 结果index.html不显示任何行号。我已尝试启用配置选项jupyter\u sphinx\u linenos和jupyter\u sphinx\u continue\u linenos,但没有效果。这里少

以下是一个简单的配方:

  • 通过Sphinx quickstart在空根目录中创建最简单的Sphinx项目
  • 让一切都处于默认状态
  • 将“jupyter_sphinx”添加到conf.py中的扩展列表中
  • 根据扩展的文档,向index.rst添加一个简单的Python代码块:
  • 在根目录下创建html
  • 结果index.html不显示任何行号。我已尝试启用配置选项
    jupyter\u sphinx\u linenos
    jupyter\u sphinx\u continue\u linenos
    ,但没有效果。这里少了什么


    jupyter\u sphinx
    version->0.2.4

    问题可能是您需要在
    conf.py
    中添加
    扩展=[“jupyter\u sphinx.execute”]
    。我无法重现错误。

    问题可能是您需要在
    conf.py
    中添加
    扩展=[“jupyter\u sphinx.execute”]
    。我无法重现错误。

    我能够重现问题(Python 3.8.0、Sphinx 3.1.2、jupyter_Sphinx 0.2.4)。使用
    extensions=[“jupyter\u sphinx.execute”]
    ,我收到了以下警告:“在设置扩展名jupyter_sphinx.execute时:
    jupyter sphinx
    已使用
    jupyter_sphinx.execute
    子模块初始化。将其替换为jupyter_sphinx。使用jupyter_sphinx.execute初始化将在0.3版中删除。我能够重现该问题(Python 3.8.0、sphinx 3.1.2、jupyter_sphinx 0.2.4)。使用
    扩展=[“jupyter_sphinx.execute”]
    ,我得到以下警告:设置扩展名jupyter_sphinx.execute时:
    jupyter sphinx
    已使用
    jupyter_sphinx.execute
    子模块初始化。将其替换为jupyter_sphinx。使用jupyter_sphinx.execute初始化将在0.3版中删除。
    .. jupyter-execute::
       :linenos:
    
       print('foo')
       print('bar')
       print('baz')