Ant*_*Man 33 javascript ipython jupyter-lab
我有最新/更新的Anaconda包.每次我尝试使用python 3.6.6绘制内容时,我在JupyterLab中收到以下错误...
Javascript错误:未定义IPython
当我使用ipython内核在Spyder中运行相同的代码时,它运行正常.一直在网上看,但似乎无法弄清楚发生了什么.任何帮助,将不胜感激.
Tom*_*way 24
Jupyter Lab确实通过jupyter-matplotlib扩展支持交互式matplotlib 。安装过程稍微复杂一些,但是可以正常工作。
和以前一样,在绘制之前调用iPython magic命令很重要:
%matplotlib widget
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
Run Code Online (Sandbox Code Playgroud)
pip install ipympl
# If using JupyterLab
conda install nodejs
jupyter labextension install @jupyter-widgets/jupyterlab-manager
jupyter labextension install jupyter-matplotlib
Run Code Online (Sandbox Code Playgroud)
pal*_*res 22
"%matplotlib笔记本在nteract中不起作用,你现在需要使用%matplotlib inline."
我可以通过安装解决同样的问题ipympl
:
pip install ipympl
Run Code Online (Sandbox Code Playgroud)
然后%matplotlib ipympl
在plot之前添加。
小智 7
使用backtrader时遇到类似的问题。这为我解决了这个问题:
cerebro.plot(iplot = False)
Run Code Online (Sandbox Code Playgroud)
小智 6
Jupyterlab 支持 jpympl。
您必须输入%matplotlib widget
jupyterlab 的最开头。
您可以更改%matplotlib inline
为特定单元格,并%matplotlib widget
根据需要再次激活。
否则,无论您重新安装该软件包多少次,您仍然会遇到错误。