当我打开Jupyter笔记本(以前是IPython)时,它默认为c:\ users \ username

我如何将其更改为另一个位置?


当前回答

如果你在linux中使用ipython,那么按照以下步骤: ! cd / directory_name / 您可以尝试在您的linux终端中工作的所有命令。 ! vi file_name.py

只需在linux命令之前指定感叹号(!)符号。

其他回答

Windows 10

Look for the jupyter_notebook_config.py in C:\Users\your_user_name\.jupyter or look it up with cortana. If you don't have it, then go to the cmd line and type: jupyter notebook --generate-config Open the jupyter_notebook_config.py and do a ctrl-f search for: c.NotebookApp.notebook_dir Uncomment it by removing the #. Change it to: c.NotebookApp.notebook_dir = 'C:/your/new/path' Note: You can put a u in front of the first ', change \\\\ to /, or change the ' to ". I don't think it matters. Go to your Jupyter Notebook link and right click it. Select properties. Go to the Shortcut menu and click Target. Look for %USERPROFILE%. Delete it. Save. Restart Jupyter.

在Windows上的iPython Notebook中,这对我来说很有效:

cd d:\folder\

对于Mac OS X,目标目录中有空格(后续使用@pheon)。在第2行$(…)周围添加额外的双引号。参见:https://stackoverflow.com/a/1308838(肖恩·布莱特)

#!/bin/bash
cd "$(dirname "$0")" && pwd
ipython notebook

试试nbopen模块。当你安装并将其与windows资源管理器集成在一起时,你将能够通过双击打开任何笔记本电脑。

找到你的ipython二进制文件。如果你使用anaconda在mac上安装ipython-notebook,它很可能会在/Users/[name]/anaconda/bin/目录下

在那个目录下,而不是启动你的笔记本

./ipython notebook

添加——notebook-dir=<unicode>选项。

./ipython notebook --notebook-dir=u'../rel/path/to/your/python-notebooks'

我在ipython bin目录中使用bashscript启动我的笔记本:

DIR=$(dirname $0)
$DIR/ipython notebook --notebook-dir=u'../rel/path/to/your/python-notebooks'

注意-到notebook目录的路径是相对于ipython bin目录的。