gpt4 book ai didi

JavaScript 错误 : IPython is not defined in JupyterLab

转载 作者:行者123 更新时间:2023-12-02 19:38:55 30 4
gpt4 key购买 nike

我有最新/更新的 Anaconda 软件包。每次我尝试使用 python 3.6.6 绘制某些内容时,我都会在 JupyterLab 中收到以下错误...

Javascript Error: IPython is not defined

当我使用 ipython 内核在 Spyder 中运行相同的代码时,它工作得很好。一直在网上查找,但似乎无法弄清楚发生了什么。任何帮助,将不胜感激。

最佳答案

Jupyter Lab 通过 jupyter-matplotlib extension 支持交互式 matplotlib 。安装过程稍微复杂一些,但效果很好。由于ipympl Jupyter Lab版本需要NodeJS,而NodeJS需要Windows 8.1,因此ipympl也有这个要求。

和以前一样,在绘图之前调用 iPython magic 命令很重要:

用法:

%matplotlib 小部件

安装:

注意:如果将此扩展与 Jupyter Lab 一起使用,建议使用 >= 3 的版本。有关安装旧扩展的更详细说明,请参阅 instructions on ipympl github .

使用 conda

conda install -c conda-forge ipympl

# If using JupyterLab 2
conda install nodejs
jupyter labextension install @jupyter-widgets/jupyterlab-manager
jupyter lab build

# Later, if updating a previous Lab install:
conda install ipympl
jupyter lab build

使用点

pip install ipympl

# If using JupyterLab 2
pip install nodejs-bin
jupyter labextension install @jupyter-widgets/jupyterlab-manager
jupyter labextension install jupyter-matplotlib

关于JavaScript 错误 : IPython is not defined in JupyterLab,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51922480/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com