配置jupyter notebook-----更改工作目录

配置 Jupyter notebook 

 jupyter notebook --generate-config 

 

运行之前

 

 

 

  打开“.jupyter”文件夹,可以看到里面有个配置文件。 

 

复制代码
Microsoft Windows [版本 6.1.7601]
版权所有 (c) 2009 Microsoft Corporation。保留所有权利。

C:\Users\Administrator>cd /d D:\

D:\>cd D:\SoftWare\Python\Python36\Scripts

D:\SoftWare\Python\Python36\Scripts>jupyter notebook --generate-config
Writing default config to: C:\Users\Administrator\.jupyter\jupyter_notebook_conf
ig.py

D:\SoftWare\Python\Python36\Scripts>
复制代码

 

 

 

 

 

 

 

 

 

 

  修改jupyter_notebook_config.py配置文件
  打开这个配置文件,找到“c.NotebookApp.notebook_dir=……”,把路径改成自己的工作目录。

 

 

 

 比如,这里要变更为

## The directory to use for notebooks and kernels.
c.NotebookApp.notebook_dir = 'D:\Code\jupyter-notebook'

,当然,文件夹 jupyter-notebook 需要自己创建好。 

 

 

 

 

 

 

 

 

 

  配置文件修改完成后, 以后在 jupyter notebook 中写的代码等都会保存在自己创建的目录中。 

 

 

 

 

 

 

 jupyter notebook的自定义启动(变了)
  配置文件修改成后,就可以启动 jupyter notebook 了,命令行窗口中输入 jupyter notebook
  默认浏览器就会打开一个页面 

 jupyter notebook的启动
  命令行窗口输入: jupyter notebook

  以前是

复制代码
D:\SoftWare\Python\Python36\Scripts>jupyter notebook
[I 10:37:02.828 NotebookApp] Serving notebooks from local directory: D:\SoftWare
\Python\Python36\Scripts
[I 10:37:02.828 NotebookApp] 0 active kernels
[I 10:37:02.828 NotebookApp] The Jupyter Notebook is running at: http://localhos
t:8888/?token=8f82159edecad826ce9769f126402fc58f5b87b8d1050b0d
[I 10:37:02.829 NotebookApp] Use Control-C to stop this server and shut down all
 kernels (twice to skip confirmation).
[C 10:37:02.833 NotebookApp] Copy/paste this URL into your browser when you connect for the first time, to login with a token: http://localhost:8888/?token=8f82159edecad826ce9769f126402fc58f5b87b8d10 50b0d [I 10:37:03.628 NotebookApp] 302 GET / (::1) 1.00ms [I 10:37:03.647 NotebookApp] 302 GET /tree? (::1) 5.00ms [I 10:37:05.535 NotebookApp] Accepting one-time-token-authenticated connection f rom ::1
复制代码

 

 

 

   现在是

 

复制代码
Microsoft Windows [版本 6.1.7601]
版权所有 (c) 2009 Microsoft Corporation。保留所有权利。

C:\Users\Administrator>cd /d D:\

D:\>cd D:\SoftWare\Python\Python36\Scripts

D:\SoftWare\Python\Python36\Scripts>jupyter notebook
[I 10:59:58.326 NotebookApp] Serving notebooks from local directory: D:\Code\jup
yter-notebook
[I 10:59:58.327 NotebookApp] 0 active kernels
[I 10:59:58.327 NotebookApp] The Jupyter Notebook is running at: http://localhos
t:8888/?token=e520d165636db926b824bd77fe81559555ff679cc5fdc774
[I 10:59:58.328 NotebookApp] Use Control-C to stop this server and shut down all
 kernels (twice to skip confirmation).
[C 10:59:58.332 NotebookApp]

    Copy/paste this URL into your browser when you connect for the first time,
    to login with a token:
        http://localhost:8888/?token=e520d165636db926b824bd77fe81559555ff679cc5f
dc774
[I 10:59:59.532 NotebookApp] Accepting one-time-token-authenticated connection f
rom ::1
复制代码
  • 2
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值