python - 可变关键字参数不能有默认值
问题描述
从昨天开始
import matplotlib.pyplot as plt
给我这个 ValueError “可变关键字参数不能有默认值”。
错误下方:
ValueError Traceback (most recent call last)
<ipython-input-1-a0d2faabd9e9> in <module>
----> 1 import matplotlib.pyplot as plt
~\AppData\Roaming\Python\Python37\site-packages\matplotlib\pyplot.py in <module>
30 from cycler import cycler
31 import matplotlib
---> 32 import matplotlib.colorbar
33 import matplotlib.image
34 from matplotlib import rcsetup, style
~\AppData\Roaming\Python\Python37\site-packages\matplotlib\colorbar.py in <module>
38
39 import matplotlib as mpl
---> 40 import matplotlib.artist as martist
41 import matplotlib.cbook as cbook
42 import matplotlib.collections as collections
~\AppData\Roaming\Python\Python37\site-packages\matplotlib\artist.py in <module>
58
59
---> 60 class Artist:
61 """
62 Abstract base class for objects that render into a FigureCanvas.
~\AppData\Roaming\Python\Python37\site-packages\matplotlib\artist.py in Artist()
899
900 @cbook._delete_parameter("3.3", "args")
--> 901 @cbook._delete_parameter("3.3", "kwargs")
902 def draw(self, renderer, *args, **kwargs):
903 """
~\AppData\Roaming\Python\Python37\site-packages\matplotlib\cbook\deprecation.py in _delete_parameter(since, name, func)
343 param.replace(default=_deprecated_parameter) if param.name == name
344 else param
--> 345 for param in signature.parameters.values()])
346
347 @functools.wraps(func)
~\AppData\Roaming\Python\Python37\site-packages\matplotlib\cbook\deprecation.py in <listcomp>(.0)
343 param.replace(default=_deprecated_parameter) if param.name == name
344 else param
--> 345 for param in signature.parameters.values()])
346
347 @functools.wraps(func)
~\Anaconda3\lib\inspect.py in replace(self, name, kind, annotation, default)
2547 default = self._default
2548
-> 2549 return type(self)(name, kind, default=default, annotation=annotation)
2550
2551 def __str__(self):
~\Anaconda3\lib\inspect.py in __init__(self, name, kind, default, annotation)
2474 msg = '{} parameters cannot have default values'
2475 msg = msg.format(_get_paramkind_descr(self._kind))
-> 2476 raise ValueError(msg)
2477 self._default = default
2478 self._annotation = annotation
ValueError: variadic keyword parameters cannot have default values
我试图卸载 matplotlib 并重新安装它并安装不同的版本,但似乎没有任何效果
有人有其他想法吗?谢谢你
解决方案
推荐阅读
- python - 为图文配对数据构建 TfRecord
- c++ - AVX2:分配给 __m256i 类成员时出现分段错误
- sqlplus - 使用 ACCEPT 命令示例
- javascript - 使用 Cordova 通过服务器提供商连接到 mysql
- python-3.x - 创建动态字典名称
- reactjs - NavBar 在 Reactjs 中不工作 MDBootstrap
- sql - 将多值依赖项放在自己的表中但感到困惑
- php - 如何使用 php 从这样的 html 响应中选择元素?
- python - 我有一个 xpath 列表,如何在不同的选项卡中打开它们中的每一个?
- java - Java.lang.IllegalStateException:提交响应后无法调用 sendRedirect()