jupyter lab的初步使用

原文链接:https://www.jianshu.com/p/90982d195160 也是我的账号~

前几天上课老师提到jupyter lab这个jupyter notebook的提升版本,就兴致勃勃地去试了一下。

因为我用的是Anaconda这个工具,所以是通过Ananconda安装jupyter lab的。

打开Anaconda Prompt输入conda install jupyterlab

等待安装完成即可。

本来以为这样就可以使用了,在终端或Anaconda Prompt输入jupyter lab后竟然报错:

ImportError: cannot import name 'ensure_dir_exists'

然后试图打开原来就有的jupyter notebook也报了同样的错误。

Google该错误后发现需要手动更新jupyter_core和jupyter_client。于是在Anaconda Prompt中输入conda update jupyter_core jupyter_client

等待完成再输入jupyter notebook或者jupyter lab就都可以用啦~

感受一下jupyter lab的页面


jupyter lab的初步使用_第1张图片

如图所示,这里显示了可用的几种notebook和console,Notebook下面是根据个人电脑上的python版本不同而不同的,可以选择任意一个版本打开,比如我选择第一个:



接下来打开其中一个console看看:


jupyter lab的初步使用_第2张图片

console起到终端的作用,输入一条语句就会给出相应的输出:


jupyter lab的初步使用_第3张图片

下面还有一个文本编辑器,用来编辑文本。

jupyter lab可以兼容jupyter notebook,功能也更强大。

另外,网上看到一个在指定文件夹打开jupyter lab或者notebook的技巧:

键盘Shift+鼠标右键->在此处打开命令窗口-> 在弹出的命令窗口中输入:jupyter notebook 或jupyter lab

(参考  https://blog.csdn.net/tina_ttl/article/details/51031113)

不过在我的系统里(win10)按照上述方法只能找到  在此处打开PowerShell窗口。其实PowerShell有cmd的功能,比cmd更强大,不过我还没有了解啦~  

所以在PowerShell窗口输入jupyter lab也是一样的。

初步使用就到这里啦~

你可能感兴趣的:(Python)