jupyter notebook 设置默认浏览器和工作地址

在windows下打开jupyter notebook时,首先是win+r打开控制台然后输入ipython notebook打开时会默认使用IE浏览器,但是只显示一个home不能打开使用,这是因为不支持该浏览器的原因。

1、win+r   然后输入jupyter notebook --generate-config

2、按照上面的路径找到jupyter_notebook_config.py,用能打开该文件的打开该文件

3、查找,browser,找到如下代码:

## Specify what command to use to invoke a web browser when opening the notebook.
#  If not specified, the default browser will be determined by the `webbrowser`
#  standard library module, which allows setting of the BROWSER environment
#  variable to override it.
#c.NotebookApp.browser = u''
也有可能#c.NotebookApp.browser = u''这句没有u是这样#c.NotebookApp.browser = ''

4、在这句后面加上

import webbrowser
webbrowser.register('chrome', None, webbrowser.GenericBrowser(u'C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe'))
c.NotebookApp.browser = 'chrome'
这里使用的是chrome浏览器,推荐使用,如果你使用火狐之类的也可以。

windows下地址一定是要用\\的不然不对。

另外如果还是不行可以考录改一下工作路径,或者觉得默认路径很麻烦的也可以改工作路径

5、更改工作路径

## Dict of Python modules to load as notebook server extensions.Entry values can
#  be used to enable and disable the loading ofthe extensions. The extensions
#  will be loaded in alphabetical order.
#c.NotebookApp.nbserver_extensions = {}

## The directory to use for notebooks and kernels.
#c.NotebookApp.notebook_dir = ''

在这后面加上

c.NotebookApp.notebook_dir = 'D:\\anaconda\\nootbookwork'

路径自己决定就可以,没有特定要求。

记住路径中\一定要换成\\

原文链接:https://blog.csdn.net/qianyayun19921028/article/details/84662789

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值