安装方法
python pip install jupyter -i https://pypi.tuna.tsinghua.edu.cn/simple
打印沒有输出时降低版本
python -m pip install psutil==5.9.0 -i https://pypi.tuna.tsinghua.edu.cn/simple
修改配置文件
jupyter notebook --generate-config
参数配置
c.NotebookApp.ip='*' # * 代表所有iP都能访问 ,也可以指定ip
c.NotebookApp.password = u'sha1:ce...' # 刚才复制的那个密文
c.NotebookApp.open_browser = False # 禁止自动打开浏览器
c.NotebookApp.port =8888 #指定一个端口
c.ServerApp.notebook_dir = 'D:\jupyter' #指定工作空间
c.PAMAuthenticator.encoding = 'utf8' #指定utf-8编码,解决读取中文路径或者文件乱码问题
c.ServerApp.token = '' #设置默认token
c.ContentsManager.untitled_file = '' #修改默认文件名
c.ContentsManager.untitled_directory = ''
c.ServerApp.disable_check_xsrf = True # 屏蔽xsrf认证
c.ServerApp.tornado_settings = {
'headers': {
'Access-Control-Allow-Origin': '*' # 或者指定允许跨域的域名
}
}
跨越问题 关闭token后需要添加
c.NotebookApp.allow_origin = '*'