jupyter lab的目录调整及设置默认浏览器为chrome的方法
1. Jupyter 默认目录调整
首先要找到jupyter生成的配置文件 jupyter_notebook_config.py 。如果没有,在 anaconda prompt 中用如下命令生成一个:
jupyter notebook --generate-config
打开文件jupyter_notebook_config.py,在文件中找到
## The directory to use for notebooks and kernels.
#c.NotebookApp.notebook_dir = ''
将默认目录改为 D:/Python_prj/myproject :
## The directory to use for notebooks and kernels.
#c.NotebookApp.notebook_dir = ''
c.NotebookApp.notebook_dir = 'D:/Python_prj/myproject'
2. Jupyter 默认浏览器调整
在文件jupyter_notebook_config.py中,找到
## 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 = ''
添加如下代码,将浏览器设为chrome:
import webbrowser
webbrowser.register('chrome', None, webbrowser.GenericBrowser(u'C:/Program Files (x86)/Google/Chrome/Application/chrome.exe'))
c.NotebookApp.browser = 'chrome'
补充知识:修改anaconda中jupyter notebook的默认浏览器详细说明
1、打开anaconda prompt
2、输入jupyter notebook --generate-config
3、显示出jupyter_notebook_config.py 文件所在目录。找到这个文件,用记事本打开。
4、在# c.NotebookApp.browser = '''' 后加入下面语句块:
import webbrowser
webbrowser.register("chrome",None,webbrowser.GenericBrowser(u"C:\\ProgramFiles(x86)\\Google\\Chrome\\Application\\chrome.exe"))
c.NotebookApp.browser = 'chrome'
5、上条中红色字体应替换为本机中chrome实际安装地,查看方法为开始菜单-chrome-右键点击属性,快捷方式页签有目标,是完整路径,粘在上面即可。注意表示目录的“\”要改变为双“\”
以上这篇jupyter lab的目录调整及设置默认浏览器为chrome的方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持脚本之家。
相关文章
python3.6 实现AES加密的示例(pyCryptodome)
本篇文章主要介绍了python3.6 实现AES加密的示例(pyCryptodome),小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧2018-01-01
Python Handler处理器和自定义Opener原理详解
这篇文章主要介绍了Python Handler处理器和自定义Opener原理详解,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友可以参考下2020-03-03


最新评论