这两天装Anaconda跑测试环境 发现 新安装的jupyter notebook 一直跳转到C:\Users\240712\AppData\Roaming\jupyter\runtime目录下面的.html文件 而不是跳转到设置的jupyter工作路径 昨天找了一天bug 今天终于解决了
这是我自己设置的工作目录路径
## DEPRECATED, use root_dir.
# Default: ''
c.ServerApp.notebook_dir = 'D:\Jupyter'
在jupyter_notebook_config.py文件中把 c.ServerApp.use_redirect_file = True 更改为 c.ServerApp.use_redirect_file = False 注意到 去掉# 顶格写
(没有这个文件的可以去自己搜一下 去prompt 命令里面 运行一下jupyter notebook --generate-config)
# Default: True
c.ServerApp.use_redirect_file = False
我用的是谷歌默认浏览器
如果发现浏览器都跳转不出来 参考我的.py文件
import webbrowser
webbrowser.register("chrome",None,webbrowser.GenericBrowser("C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe"))
c.NotebookApp.browser = 'chrome'
# Configuration file for notebook.
c = get_config() #noqa
#------------------------------------------------------------------------------
# Application(SingletonConfigurable) configuration
#------------------------------------------------------------------------------