本文介绍了我应该在哪里放置我的设置和配置文件以用于IPython / Jupyter 4.0?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近更新了IPython(到4.0)并且在一段时间后没有使用它们开始使用笔记本(因为之前,我认为,并且发现我的一些设置需要修改并从〜/ .ipython / 〜/ .jupyter /

I've recently updated IPython (to 4.0) and have started using Notebooks after a period of some time not using them (since before The Big Split, I think), and have discovered that some of my settings need to be modified and moved from ~/.ipython/ to ~/.jupyter/.

例如,它出现 NotebookManager.notebook_dir in

~/.ipython/profile_default/ipython_notebook_config.py

被忽略,其功能 FileContentsManager.root_dir

~/.jupyter/jupyter_notebook_config.py

除了这样的孤立事件之外,我还不清楚配置如何现在可以使用ettings和profile。特别是哪些文件应该位于哪里,以及它们应该包含什么。例如,如果我生成一个新的配置文件

Beyond isolated incidents like this, however, it's not clear to me how the configuration settings and profiles now work. In particular what files should be located where, and what they should contain. If, for example, I generate a new profile with

ipython profile create foo

我现在获得的文件与以前不同(和我现有的配置文件中存在的文件不同):我曾经去过的地方

I now get different files than I used to (and than those present in my existing profiles): where I used to get

ipython_config
ipython_notebook_config.py
ipython_nbconvert_config.py

我现在得到

ipython_config.py
ipython_kernel_config.py

尽可能接近我的 ipython_notebook_config.py 被使用。

and as near as I can tell, none of my ipython_notebook_config.py are used.

这个(以及有限的文档)让我有点困惑我应该把我的设置和配置文件放在哪里用于IPython / Jupyter 4.0,具体来说:

This (and the limited documentation) all leaves me a bit confused about where should I place my settings and profiles for use with IPython/Jupyter 4.0, specifically:


  1. 我应该在哪里放置与笔记本相关的常规设置供所有内核/配置文件使用? (我看到有些进入〜/ .jupyter / jupyter_notebook_config.py ,但我不清楚这些是否会覆盖从其他地方加载的设置。)

  2. 我应该在哪里放置特定于配置文件的设置以用于笔记本电脑? (我可以继续在〜/ .ipython / profile_someprofile / 目录中使用 ipython_notebook_config.py 文件吗?)

  3. 我应该在哪里放置特定于内核的设置以供所有配置文件和应用程序使用。 (例如,IPython为shell和笔记本中的所有配置文件使用的设置应该去哪里?)

  4. 我应该如何修改或更新现有的IPython配置文件以用于4.0.0? (例如,应该都有一个 ipython_kernel_config.py 文件;我应该删除 ipython_notebook_config.py ipython_nbconvert_config.py 文件?)

  1. Where should I place general notebook-related settings for use by all kernels/profiles? (I see that some go in ~/.jupyter/jupyter_notebook_config.py, but it's not clear to me whether these would override settings loaded from elsewhere.)
  2. Where should I place profile-specific settings for use with notebooks? (Can I continue to use ipython_notebook_config.py files in ~/.ipython/profile_someprofile/ directories?)
  3. Where should I place kernel-specific settings for use by all profiles and applications. (For example, where should settings used by IPython for all profiles in both the shell and notebooks go?)
  4. How should I modify or update existing IPython profiles for use with 4.0.0? (For example, should all have a ipython_kernel_config.py file; should I delete the ipython_notebook_config.py and ipython_nbconvert_config.py files?)






OS X 10.10.4; Xcode 6.4; CLT:6.4.0.0.1; Clang:6.1; Python Python 2.7.10(Homebrew); Jupyter 4.0.4; IPython 4.0.0。


OS X 10.10.4; Xcode 6.4; CLT: 6.4.0.0.1; Clang: 6.1; Python Python 2.7.10 (Homebrew); Jupyter 4.0.4; IPython 4.0.0.

推荐答案

首先,检查〜/ .jupyter /中的内容/ code>文件夹。问题中的一些评论提到你有一个名为MIGRATED的文件只包含一个时间戳。

First of all, check what's in your ~/.jupyter/ folder. Some of the comments under the question mention you have a file named "MIGRATED" that contains only a timestamp.

如果你处于这种状态,请运行命令: jupyter notebook --generate-config 这将创建一个新文件〜/ .jupyter / jupyter_notebook_config.py 。如果您已有此文件,则无需运行此命令。

If you are in this state, run the command: jupyter notebook --generate-config which will create a new file ~/.jupyter/jupyter_notebook_config.py. If you already have this file, you don't need to run this command.

此文件是您放置将修改IPython Notebook行为的代码的位置。这是一个完全注释掉(并且记录良好)的文件。

This file is where you put the code that will modify your IPython Notebook behavior. It's a fully commented out (and well documented) file.

我打开了一个相关问题(?处理尝试设置多个配置文件,这些配置文件目前尚未得到答复。

I have a related question open (How do I get IPython profile behavior from Jupyter 4.x?) that deals with attempting to set up multiple profiles, which is currently unanswered.

这篇关于我应该在哪里放置我的设置和配置文件以用于IPython / Jupyter 4.0?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-06 02:03