我应该在哪里放置我的设置和配置文件以用于 IPython/Jupyter 4.0? [英] Where should I place my settings and profiles for use with IPython/Jupyter 4.0?

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

问题描述

我最近更新了 IPython(到 4.0),并且在一段时间不使用笔记本后开始使用它们(自从 The Big Split,我认为),并且发现我的一些设置需要修改并从 ~/.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/.

例如,看起来

~/.ipython/profile_default/ipython_notebook_config.py

被忽略,其功能替换为 FileContentsManager.root_dir

~/.jupyter/jupyter_notebook_config.py

除了像这样的孤立事件之外,我不清楚配置设置和配置文件现在如何工作.特别是哪些文件应该放在什么地方,它们应该包含什么.例如,如果我使用

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 和 notebook 中的所有配置文件使用的设置应该放在哪里?)
  4. 我应该如何修改或更新现有的 IPython 配置文件以用于 4.0.0?(例如,是否都应该有一个 ipython_kernel_config.py 文件;我是否应该删除 ipython_notebook_config.pyipython_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;铿锵:6.1;Python Python 2.7.10(自制软件);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/ 文件夹中的内容.该问题下的一些评论提到您有一个名为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.

我有一个相关问题未解决(我如何从 Jupyter 4.x 获得 IPython 配置文件行为?)处理尝试设置多个配置文件,目前尚未答复.

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?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆