Jupyter 安装使用笔记

1. Anaconda下安装Jupyter Notebook (Windows10)

pip install jupyter

2. 运行Jupyter

jupyter notebook

选择默认浏览器Chrome,此时弹出Jupyter页面但显示为空白
解决办法:

jupyter notebook --generate-config

然后打开 C:/user/.jupyter/jupyter_notebook_config.py 并添加如下代码

import webbrowser
webbrowser.register('chrome', None, webbrowser.GenericBrowser(u'C:\Program Files (x86)\Google\Chrome\Application\chrome.exe'))
c.NotebookApp.browser = 'chrome'

之后仍未奏效。在清理浏览器缓存后,页面可以正常显示。

3. 在 Notebooks 中使用 R,Julia 和JavaScript

4. 插件

pip install jupyter_contrib_nbextensions
jupyter contrib nbextension install --user

安装后会出现Nbextensions选项卡
在这里插入图片描述

pip install qgrid
jupyter nbextension enable --py --sys-prefix qgrid
# only required if you have not enabled the ipywidgets nbextension yet
jupyter nbextension enable --py --sys-prefix widgetsnbextension
# install jupyterthemes
pip install jupyterthemes

# upgrade to latest version
pip install --upgrade jupyterthemes

# list available themes
# onedork | grade3 | oceans16 | chesterish | monokai | solarizedl | solarizedd
jt -l

# select theme...
jt -t chesterish

# restore default theme
# NOTE: Need to delete browser cache after running jt -r
# If this doesn't work, try starting a new notebook session.
jt -r

# toggle toolbar ON and notebook name ON
jt -t grade3 -T -N

# toggle kernel logo.  kernel logo is in same container as name
# toggled with -N.  That means that making the kernel logo visible is
# pointless without also making the name visible
jt -t grade3 -N -kl

# set code font to 'Roboto Mono' 12pt
# (see monospace font table below)
jt -t onedork -f roboto -fs 12

# set code font to Fira Mono, 11.5pt
# 3digit font-sizes get converted into float (115-->11.5)
# 2digit font-sizes > 25 get converted into float (85-->8.5)
jt -t solarizedd -f fira -fs 115

# set font/font-size of markdown (text cells) and notebook (interface)
# see sans-serif & serif font tables below
jt -t oceans16 -tf merriserif -tfs 10 -nf ptsans -nfs 13

# adjust cell width (% screen width) and line height
jt -t chesterish -cellw 90% -lineh 170

# or set the cell width in pixels by leaving off the '%' sign
jt -t solarizedl -cellw 860

# fix the container-margins on the intro page (defaults to 'auto')
jt -t monokai -m 200

# adjust cursor width (in px) and make cursor red
# options: b (blue), o (orange), r (red), p (purple), g (green), x (font color)
jt -t oceans16 -cursc r -cursw 5

# choose alternate prompt layout (narrower/no numbers)
jt -t grade3 -altp

# my two go-to styles
# dark
jt -t onedork -fs 95 -altp -tfs 11 -nfs 115 -cellw 88% -T
# light
jt -t grade3 -fs 95 -altp -tfs 11 -nfs 115 -cellw 88% -T

5. 开始使用

  • 命令行可直接使用shell命令(如 !pwd)
  • Shift + Enter 可直接执行代码块
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: Jupyter Notebook 创建笔记本失败的原因可能有很多,下面是一些可能的解决方案: 1. 检查 Jupyter Notebook 是否已经正确安装。 2. 检查 Jupyter Notebook 是否已经正确配置,特别是配置文件中的路径是否正确。 3. 检查你是否有运行 Jupyter Notebook 的权限。 4. 检查是否有其他程序占用了 Jupyter Notebook 默认使用的端口。 5. 检查你的网络连接是否正常。 6. 检查你的系统是否有其他问题,例如缺少依赖包。 如果仍然无法解决问题,建议查看 Jupyter Notebook 的官方文档和社区论坛,或者提交问题给 Jupyter Notebook 的技术支持团队。 ### 回答2: jupyter notebook创建笔记本失败可能会有多种原因。首先,确保已正确安装jupyter notebook,并且版本兼容。其次,检查所选用的环境是否正常运行,例如Python环境是否成功安装和配置。如果安装了Anaconda,则可以使用Anaconda Navigator或Anaconda Prompt来启动jupyter notebook。如果使用基于命令行的安装,则可以在终端中输入“jupyter notebook”命令来启动。 如果在启动jupyter notebook时出现错误消息,请注意查看错误信息。常见的错误可能包括端口冲突、依赖项缺失或权限问题。您可以尝试使用不同的端口号来启动jupyter notebook,例如“jupyter notebook --port 8889”来使用端口8889。另外,确保所需的依赖项已安装,可以通过pip或conda安装缺失的依赖项。 此外,如果您是在虚拟环境中使用jupyter notebook,并且无法启动或创建笔记本,请确保已正确激活虚拟环境。您可以使用命令行中的“activate <环境名>”(Windows)或“source activate <环境名>”(Linux/Mac)来激活虚拟环境。 如果尝试了上述方法仍然无法解决问题,建议尝试重新安装jupyter notebook或更改到其他類似的環境。同时,您可以在jupyter notebook的官方网站或各种技术论坛上寻找相关的解决方案。 ### 回答3: Jupyter Notebook创建笔记本失败可能有以下几个原因: 1. 安装问题:如果您刚刚安装Jupyter Notebook,可能是因为安装出现了问题。您可以尝试重新安装Jupyter Notebook,确保按照正确的步骤进行操作。 2. 内核问题:Jupyter Notebook依赖于各种编程语言的内核,例如Python。如果您在创建笔记本时选择了错误的内核,可能会导致创建失败。请确保您选择了正确的内核。 3. 端口冲突:Jupyter Notebook在创建笔记本时会在本地启动一个服务器。如果您的端口被其他程序占用,可能会导致创建笔记本失败。您可以尝试更改Jupyter Notebook的端口号,或者关闭其他占用该端口的程序。 4. 文件权限问题:如果您没有足够的权限在指定目录下创建文件,可能会导致创建笔记本失败。请确保您具有正确的文件权限,或者尝试在其他目录下创建笔记本。 5. 资源限制:Jupyter Notebook在创建笔记本时需要一定的系统资源,例如内存和存储空间。如果您的系统资源不足,可能会导致创建笔记本失败。您可以尝试关闭其他占用资源的程序,或者增加系统资源配置。 如果您尝试了以上方法仍然无法解决问题,建议您查阅Jupyter Notebook的官方文档或者寻求相关技术支持。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值