我试着按照Jupyter笔记本文档上的说明去做。
不幸的是,我还没弄明白。这个“开始”的领域到底在哪里?
我有一个windows 7(64位)系统,安装了Anaconda3(不在C驱动器中)。我想改变Jupyter开始文件夹的位置。
我试着按照Jupyter笔记本文档上的说明去做。
不幸的是,我还没弄明白。这个“开始”的领域到底在哪里?
我有一个windows 7(64位)系统,安装了Anaconda3(不在C驱动器中)。我想改变Jupyter开始文件夹的位置。
当前回答
这就是我在Windows上为Jupyter/Anaconda所做的。这个方法 还传递给jupyter一个python配置脚本。我用它来添加一个路径到我的项目父文件夹:
在某个地方创建jnote.bat:
@echo off
call activate %1
call jupyter notebook "%CD%" %2 %3
pause
在同一个文件夹中创建一个windows快捷方式jupyter-notebook
TARGET: D:\util\jnote.bat py3-jupyter --config=jupyter_notebook_config.py
START IN: %CD%
将jupyter图标添加到快捷方式。
在jupyter projects文件夹中执行以下操作:
创建jupyter_notebook_config.py,把你喜欢的东西放在这里:
import os
import sys
import inspect
# Add parent folder to sys path
currentdir = os.path.dirname(os.path.abspath(
inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirname(currentdir)
os.environ['PYTHONPATH'] = parentdir
然后粘贴jupyte -notebook快捷方式。双击 快捷键和你的jupyter就会亮起来,包裹就会放进去 父文件夹将可用。
其他回答
这个问题已经很老了,而且似乎已经解决了,但如果只是为了提醒自己下次遇到这个问题,这里有另一个解决方案(不过只在Windows 10上测试)。
jupyter笔记本的快捷方式(从开始菜单,桌面快捷方式或固定到任务栏)调用许多脚本(大概是初始化jupyter笔记本等),这是写在目标文本字段从快捷方式的属性窗口。 附加
--notebook-dir='C:/Your/Desired/Start/Directory/'
应该在指定的目录下启动笔记本(正如@Victor O指出的那样,它不能是驱动器,但必须是文件夹)。 如果这还不能解决问题,也可以在Start in字段中添加相同的目录。
注意:我在Target字段中使用了正斜杠,在Start in字段中使用了反斜杠。如果你好奇哪种组合是有效的,可以随意改变。
另外,这不是我的想法,但我忘记了它来自哪里(我检查了之前安装的快捷方式,因为我确定没有尝试过这个页面的任何东西,而是从OP提供的链接中建议的方法。)如果有人想提供链接,请提供。
很抱歉我不能在此基础上添加任何研究,但这个解决方案在四个独立的系统上都适用,而且实现起来相当简单。
您可以从conda命令行更改配置:
运行anaconda命令提示符 运行jupyter notebook—generate-config 你应该在家里创建一个目录。jupyter/,文件是jupyter_notebook_config.py 取消注释并编辑字段c.NotebookApp.notebook_dir
感谢克莱门特https://groups.google.com/a/continuum.io/forum/#!主题/蟒蛇/ gqRwT_SxGBw
Windows 10:
寻找木星笔记本快捷方式(在开始菜单>Anaconda)。 右键单击“属性”。 如截图所示,添加你想要的路径(但使用/ not \ for path):
I've just installed Anaconda on Windows 10 and have been trying to configure Jupyter to open in my specified directory, including updating the Jupyter config file as suggested above. This didn't work. After viewing other threads, I stumbled on file "notebook.bat" in the .anaconda\scripts\ folder. This launches Jupyter. I took a copy of the .bat file into the folder I want to work in, ran it, and voila - Jupyter launches in that folder and I no longer see every folder on my PC, just the one I want. One desktop shortcut later and I'm a happy 'non-techy'. I hope this helps.
如果你正在使用WinPython而不是anaconda,那么你需要导航到安装WinPython的目录,例如C:\WPy-3670\settings\.jupyter\jupyter_notebook_config.py
您需要编辑这个文件并找到这一行 # c.NotebookApp。Notebook_dir = "将其更改为例如。 c.NotebookApp。notebook_dir = 'D:/your_own_folder/ contains /jupyter_notes'
您还需要将反斜杠\改为正斜杠/。还要确保通过删除#来取消该行的注释