简体   繁体   English

iPython Notebook中的默认笔记本目录 - iPython 3.0.0

[英]Default notebook directory in iPython Notebook - iPython 3.0.0

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. 我升级到iPython 3.0.0(Python 3.4;使用Anaconda环境; Mac OSX 10.9.5),打开新的iPython Notebook会话的行为似乎已经改变。 I have set the c.NotebookManager.notebook_dir option in ipython_notebook_config.py to a particular directory; 我已经设置了c.NotebookManager.notebook_dir在选项ipython_notebook_config.py到一个特定的目录; 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

I've checked that I've modified the config files that iPython is using; 我已经检查过我已经修改了iPython正在使用的配置文件; 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. 打开它说Using existing profile dir: '/Users/ite1/.ipython/profile_default'和那里的配置文件确实设置为适当的默认值。

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. 我还在我的所有配置文件中重新生成配置文件,在每个配置文件中设置notebook_dir,但仍然没有得到我认为正确的行为。

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. 事实上这在最后一个版本中起作用并且现在不起作用,并且它在命令行而不是配置文件中运行,这让我想知道这是否是一个错误,但是也可能是设置默认值的方法要打开的目录已更改。

The config has changed for this; 配置已更改为此; it's now FileContentsManager.root_dir . 它现在是FileContentsManager.root_dir

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM