【问题标题】:jupyter lab 2.2.2 %pylab inline deprecation warningsjupyter lab 2.2.2 %pylab 内联弃用警告
【发布时间】:2020-08-06 08:49:00
【问题描述】:

升级matplotlibjupyterjupyter lab 后,内联魔法会产生弃用警告。虽然这有点帮助,但这些警告会妨碍您。

当然可以关闭警告: import warnings warnings.filterwarnings('ignore') 但这似乎不是最好的方法。

问题:如何在不关闭所有警告的情况下解决这些警告?

魔法:

%pylab inline

警告:

In C:\Python37\lib\site-packages\matplotlib\mpl-data\stylelib\_classic_test.mplstyle: 
The text.latex.preview rcparam was deprecated in Matplotlib 3.3 and will be removed two minor releases later.
In C:\Python37\lib\site-packages\matplotlib\mpl-data\stylelib\_classic_test.mplstyle: 
The mathtext.fallback_to_cm rcparam was deprecated in Matplotlib 3.3 and will be removed two minor releases later.
In C:\Python37\lib\site-packages\matplotlib\mpl-data\stylelib\_classic_test.mplstyle: Support for setting the 'mathtext.fallback_to_cm' rcParam is deprecated since 3.3 and will be removed two minor releases later; use 'mathtext.fallback : 'cm' instead.
In C:\Python37\lib\site-packages\matplotlib\mpl-data\stylelib\_classic_test.mplstyle: 
The validate_bool_maybe_none function was deprecated in Matplotlib 3.3 and will be removed two minor releases later.
In C:\Python37\lib\site-packages\matplotlib\mpl-data\stylelib\_classic_test.mplstyle: 
The savefig.jpeg_quality rcparam was deprecated in Matplotlib 3.3 and will be removed two minor releases later.
In C:\Python37\lib\site-packages\matplotlib\mpl-data\stylelib\_classic_test.mplstyle: 
The keymap.all_axes rcparam was deprecated in Matplotlib 3.3 and will be removed two minor releases later.
In C:\Python37\lib\site-packages\matplotlib\mpl-data\stylelib\_classic_test.mplstyle: 
The animation.avconv_path rcparam was deprecated in Matplotlib 3.3 and will be removed two minor releases later.
In C:\Python37\lib\site-packages\matplotlib\mpl-data\stylelib\_classic_test.mplstyle: 
The animation.avconv_args rcparam was deprecated in Matplotlib 3.3 and will be removed two minor releases later.

【问题讨论】:

  • _classic_test.mplstyle 用于测试,见here。我想你可以简单地删除它。
  • 删除后警告消失。不过,这似乎是一种解决方法。我尝试卸载matplotlib,就像在 github 问题中一样,这没有帮助。

标签: python matplotlib jupyter-notebook jupyter jupyter-lab


【解决方案1】:

据我所知,Pylab 已被弃用。请参阅下面的链接(我能找到的最好的,Ipython repo 上的一个线程)。我认为它破坏命名空间存在很多问题。我看到的典型建议只是将其替换为%matplotlib inline

https://github.com/ipython/ipython/issues/5071/#issuecomment-34547616

【讨论】:

    猜你喜欢
    • 2019-04-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多