iPython Notebook中的默认笔记本目录 - iPython 3.0.0 [英] Default notebook directory in iPython Notebook - iPython 3.0.0

查看:162
本文介绍了iPython Notebook中的默认笔记本目录 - iPython 3.0.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我升级到iPython 3.0.0(Python 3.4;使用Anaconda环境; Mac OSX 10.9.5),打开新的iPython Notebook会话的行为似乎已经改变。我已将 ipython_notebook_config.py 中的 c.NotebookManager.notebook_dir 选项设置为特定目录;这曾经导致浏览器在该目录中打开,但现在浏览器在当前工作目录中打开:

I upgraded to iPython 3.0.0 (Python 3.4; using the Anaconda environment; Mac OSX 10.9.5) and the behavior on opening a new iPython Notebook session seems to have changed. I have set the c.NotebookManager.notebook_dir option in ipython_notebook_config.py to a particular directory; this used to cause the browser to open in that directory, but now the browser opens in the current working directory:

Serving notebooks from local directory: /Users/ite1

我已经检查过我已经修改了iPython的配置文件正在使用;打开它说
使用现有的配置文件目录:'/ Users /ite1 / .ipython / profile_default'
并且其中的配置文件确实已设置到适当的默认值。

I've checked that I've modified the config files that iPython is using; on opening it says Using existing profile dir: '/Users/ite1/.ipython/profile_default' and the config files in there are indeed set to the appropriate default.

我还在我的所有配置文件中重新生成配置文件,在每个配置文件中设置notebook_dir,但仍然没有得到我认为正确的行为。

I also re-generated config files in all my profiles, set the notebook_dir in each, and still didn't get what I consider correct behavior.

在命令行上设置相同的选项确实有效:

Setting the same option on the command line does work:

ipython notebook --notebook-dir "/Users/ite1/Documents/iPython notebooks"

在正确的目录中打开浏览器:

opens the browser in the correct directory:

Serving notebooks from local directory: /Users/ite1/Documents/iPython notebooks

事实上,这在最后一个版本中起作用并且现在不起作用,并且它可以从命令行而不是配置文件工作,这让我想知道这是不是一个错误,但也有可能设置默认目录的方法已经改变。

The fact that this worked in the last version and doesn't work now, and that it works from the command line but not the config files, makes me wonder if this is a bug, but it's also possible that the method for setting a default directory to open in has changed.

推荐答案

配置已经改变了;它现在是 FileContentsManager.root_dir

The config has changed for this; it's now FileContentsManager.root_dir.

这篇关于iPython Notebook中的默认笔记本目录 - iPython 3.0.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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