Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/magento/5.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/loops/2.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
Jupyter notebook 如何将IPython v3笔记本转换为Jupyter v4?_Jupyter Notebook_Jupyter - Fatal编程技术网

Jupyter notebook 如何将IPython v3笔记本转换为Jupyter v4?

Jupyter notebook 如何将IPython v3笔记本转换为Jupyter v4?,jupyter-notebook,jupyter,Jupyter Notebook,Jupyter,有没有办法将我所有的旧v3笔记本批量转换为v4(用于Jupyter) 我的本地文件系统上有很多旧的v3 IPython笔记本。在将IPython升级到Jupyter之后,每当我打开v3笔记本时,都会收到一个恼人的提示,通知我文件转换为v4。我完全同意转换,但是弹出窗口有点烦人。我想通过提前转换我所有的v3笔记本电脑来抢占先机。谢谢 有一个叫做nbconvert的工具,它应该可以做到这一点 ipython nbconvert --to=notebook testnotebook.ipynb 在恢

有没有办法将我所有的旧v3笔记本批量转换为v4(用于Jupyter)


我的本地文件系统上有很多旧的v3 IPython笔记本。在将IPython升级到Jupyter之后,每当我打开v3笔记本时,都会收到一个恼人的提示,通知我文件转换为v4。我完全同意转换,但是弹出窗口有点烦人。我想通过提前转换我所有的v3笔记本电脑来抢占先机。谢谢

有一个叫做nbconvert的工具,它应该可以做到这一点

ipython nbconvert --to=notebook testnotebook.ipynb
在恢复转换时,请始终备份旧文件 根据这一点,并不总是那么干净

这是nbconvert工具的完整帮助:

python nbconvert -h
This application is used to convert notebook files (*.ipynb) to various other
formats.

WARNING: THE COMMANDLINE INTERFACE MAY CHANGE IN FUTURE RELEASES.

Options
-------

Arguments that take values are actually convenience aliases to full
Configurables, whose aliases are listed on the help line. For more information
on full configurables, see '--help-all'.

--stdout
    Write notebook output to stdout instead of files.
--quiet
    set log level to logging.CRITICAL (minimize logging output)
--debug
    set log level to logging.DEBUG (maximize logging output)
--inplace
    Run nbconvert in place, overwriting the existing notebook (only
    relevant when converting to notebook format)
--execute
    Execute the notebook prior to export.
--init
    Initialize profile with default config files.  This is equivalent
    to running `ipython profile create <profile>` prior to startup.
--to=<CaselessStrEnum> (NbConvertApp.export_format)
    Default: 'html'
    Choices: ['custom', 'html', 'latex', 'markdown', 'notebook', 'pdf', 'python', 'rst', 'script', 'slides']
    The export format to be used.
--writer=<DottedObjectName> (NbConvertApp.writer_class)
    Default: 'FilesWriter'
    Writer class used to write the  results of the conversion
--output=<Unicode> (NbConvertApp.output_base)
    Default: ''
    overwrite base name use for output files. can only be used when converting
    one notebook at a time.
--profile-dir=<Unicode> (ProfileDir.location)
    Default: ''
    Set the profile location directly. This overrides the logic used by the
    `profile` option.
--ipython-dir=<Unicode> (BaseIPythonApplication.ipython_dir)
    Default: ''
    The name of the IPython directory. This directory is used for logging
    configuration (through profiles), history storage, etc. The default is
    usually $HOME/.ipython. This option can also be specified through the
    environment variable IPYTHONDIR.
--config=<Unicode> (BaseIPythonApplication.extra_config_file)
    Default: ''
    Path to an extra config file to load.
    If specified, load this config file in addition to any other IPython config.
--template=<Unicode> (TemplateExporter.template_file)
    Default: 'default'
    Name of the template file to use
--post=<DottedOrNone> (NbConvertApp.postprocessor_class)
    Default: ''
    PostProcessor class used to write the  results of the conversion
--reveal-prefix=<Unicode> (RevealHelpPreprocessor.url_prefix)
    Default: 'reveal.js'
    The URL prefix for reveal.js. This can be a a relative URL for a local copy
    of reveal.js, or point to a CDN.
    For speaker notes to work, a local reveal.js prefix must be used.
--profile=<Unicode> (BaseIPythonApplication.profile)
    Default: 'default'
    The IPython profile to use.
--log-level=<Enum> (Application.log_level)
    Default: 30
    Choices: (0, 10, 20, 30, 40, 50, 'DEBUG', 'INFO', 'WARN', 'ERROR', 'CRITICAL')
    Set the log level by value or name.
--nbformat=<Enum> (NotebookExporter.nbformat_version)
    Default: 4
    Choices: [1, 2, 3, 4]
    The nbformat version to write. Use this to downgrade notebooks.

To see all available configurables, use `--help-all`

Examples
--------

    The simplest way to use nbconvert is

    > ipython nbconvert mynotebook.ipynb

    which will convert mynotebook.ipynb to the default format (probably HTML).

    You can specify the export format with `--to`.
    Options include ['custom', 'html', 'latex', 'markdown', 'notebook', 'pdf', 'python', 'rst', 'script', 'slides']

    > ipython nbconvert --to latex mynotebook.ipynb

    Both HTML and LaTeX support multiple output templates. LaTeX includes
    'base', 'article' and 'report'.  HTML includes 'basic' and 'full'. You
    can specify the flavor of the format used.

    > ipython nbconvert --to html --template basic mynotebook.ipynb

    You can also pipe the output to stdout, rather than a file

    > ipython nbconvert mynotebook.ipynb --stdout

    PDF is generated via latex

    > ipython nbconvert mynotebook.ipynb --to pdf

    You can get (and serve) a Reveal.js-powered slideshow

    > ipython nbconvert myslides.ipynb --to slides --post serve

    Multiple notebooks can be given at the command line in a couple of
    different ways:

    > ipython nbconvert notebook*.ipynb
    > ipython nbconvert notebook1.ipynb notebook2.ipynb

    or you can specify the notebooks list in a config file, containing::

        c.NbConvertApp.notebooks = ["my_notebook.ipynb"]

    > ipython nbconvert --config mycfg.py
python nbconvert-h
此应用程序用于将笔记本文件(*.ipynb)转换为各种其他文件
格式。
警告:命令行接口可能在将来的版本中更改。
选择权
-------
接受值的参数实际上是full的方便别名
可配置文件,其别名列在帮助行中。更多信息
关于完整配置,请参阅“--help all”。
--stdout
将笔记本输出写入标准输出,而不是文件。
--安静的
将日志级别设置为logging.CRITICAL(最小化日志输出)
--调试
将日志级别设置为logging.DEBUG(最大化日志输出)
--就地
就地运行nbconvert,覆盖现有笔记本(仅限
转换为笔记本格式时相关)
--执行
在导出之前执行笔记本。
--初始化
使用默认配置文件初始化配置文件。这相当于
要在启动之前运行'ipython profile create'。
--to=(NbConvertApp.export_格式)
默认值:“html”
选项:[“自定义”、“html”、“latex”、“标记”、“笔记本”、“pdf”、“python”、“rst”、“脚本”、“幻灯片”]
要使用的导出格式。
--writer=(NbConvertApp.writer\u类)
默认值:“FileWriter”
Writer类用于写入转换结果
--输出=(NbConvertApp.output_base)
默认值:“”
覆盖用于输出文件的基本名称。只能在转换时使用
一次一本笔记本。
--profile dir=(ProfileDir.location)
默认值:“”
直接设置配置文件位置。这将覆盖
`profile`选项。
--ipython dir=(BaseIPythonApplication.ipython_dir)
默认值:“”
IPython目录的名称。此目录用于日志记录
配置(通过配置文件)、历史记录存储等。默认设置为
通常是$HOME/.ipython。此选项也可以通过
环境变量IPYTHONDIR。
--config=(BaseIPythonApplication.extra\u配置文件)
默认值:“”
要加载的额外配置文件的路径。
如果指定,则除了加载任何其他IPython配置之外,还加载此配置文件。
--template=(TemplateExporter.template\u文件)
默认值:“默认值”
要使用的模板文件的名称
--post=(NbConvertApp.postprocessor_类)
默认值:“”
用于写入转换结果的后处理器类
--显示前缀=(RevealHelpPreprocessor.url\u前缀)
默认值:“reveal.js”
leaver.js的URL前缀。这可以是本地副本的相对URL
或指向CDN。
要使“演讲者笔记”起作用,必须使用local reveal.js前缀。
--profile=(BaseIPythonApplication.profile)
默认值:“默认值”
要使用的IPython配置文件。
--日志级别=(Application.log\u级别)
默认值:30
选项:(0、10、20、30、40、50、‘调试’、‘信息’、‘警告’、‘错误’、‘关键’)
按值或名称设置日志级别。
--nbformat=(NotebookExporter.nbformat_版本)
默认值:4
选择:[1,2,3,4]
要写入的格式版本。使用此选项可降级笔记本电脑。
要查看所有可用的配置文件,请使用“---help all`
例子
--------
使用nbconvert最简单的方法是
>ipython nbconvert mynotebook.ipynb
将mynotebook.ipynb转换为默认格式(可能是HTML)。
您可以使用“---to”指定导出格式。
选项包括['custom'、'html'、'latex'、'markdown'、'notebook'、'pdf'、'python'、'rst'、'script'、'slides']
>ipython nbconvert--到latex mynotebook.ipynb
HTML和LaTeX都支持多个输出模板。乳胶包括
“基础”、“文章”和“报告”。HTML包括“基本”和“完整”。你
可以指定所用格式的样式。
>ipython nbconvert--转换为html--模板基本mynotebook.ipynb
您还可以通过管道将输出传输到标准输出,而不是文件
>ipython nbconvert mynotebook.ipynb--标准输出
PDF是通过latex生成的
>ipython nbconvert mynotebook.ipynb--转换为pdf
您可以获得(并提供)一个leaver.js支持的幻灯片
>ipython nbconvert myslides.ipynb--到幻灯片--后期服务
在几个小时内,可以在命令行中提供多个笔记本
不同的方式:
>ipython nbconvert笔记本电脑*.ipynb
>ipython nbconvert notebook1.ipynb notebook2.ipynb
也可以在配置文件中指定笔记本列表,其中包含:
c、 NbConvertApp.notebooks=[“my_notebook.ipynb”]
>ipython nbconvert--配置mycfg.py

解决方案成功了吗?此版本的命令有效:
jupyter nbconvert--inplace--to=notebook*.ipynb