- 命令行法
在AnacondaPrompt命令行输入
jupyter notebook --notebook-dir= D:\DaPy1
也可以将目录切换成D:\DaPy1,然后运行Jupyter Notebook,如
D:>cd DaPy1
D:\DaPy1>jupyter notebook
- Powershell法
进入工作目录文件夹(如D:/DaPy1)→Shift键+鼠标右键→此处打开Powershell窗口→在弹出的命令窗口中输入Jupyter Notebook,如PS D:\DaPy1> Jupyter Notebook。
- 修改config.py
在CMD(Win+R)中使用jupyter notebook --generate-config创建jupyter_notebook_ config.py文档,在文档中将"c.NotebookApp.notebook_dir = ''修改为
c.NotebookApp.notebook_dir = ‘D:\DaPy1’
这样以后每次启动时自动到目录’D:\DaPy1’下运行。
- 修改config.json
打开Anaconda安装目录下的etc文件,如C:\Anaconda3\etc\jupyter,安装目录在C:\Anaconda3,打开jupyter_notebook_config.json文件,进行如下修改即可:
{
“NotebookApp”: {
“nbserver_extensions”: {
“jupyterlab”: true,
“jupyter_nbextensions_configurator”: true
},
“notebook_dir”:“D:\DaPy1”
}
}
这样以后每次启动时自动到目录’D:\DaPy1’下运行。