Javascript错误:JupyterLab中未定义IPython

问题描述 投票:14回答:3

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

Javascript错误:未定义IPython

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

javascript ipython jupyter-lab
3个回答
16
投票

“%matplotlib笔记本在nteract中不起作用,你现在需要使用%matplotlib inline。”

加:

    %matplotlib inline

在绘制图表之前。

Quoted from


4
投票

Jupyter Lab通过jupyter-matplotlib extension支持交互式matplotlib。安装过程稍微复杂一些,但工作正常。

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

Usage:

%matplotlib widget

Installation:

使用conda

conda install -c conda-forge ipympl
# If using the Notebook
conda install -c conda-forge widgetsnbextension
# If using JupyterLab
conda install nodejs
jupyter labextension install @jupyter-widgets/jupyterlab-manager
jupyter labextension install jupyter-matplotlib

用pip

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

2
投票

需要使用Qazxswpoi和JupyterLab

%matplotlib inline
© www.soinside.com 2019 - 2024. All rights reserved.