Python 可变关键字参数不能有默认值

Python 可变关键字参数不能有默认值,python,matplotlib,anaconda,Python,Matplotlib,Anaconda,从昨天开始 import matplotlib.pyplot as plt 给我这个值错误“可变关键字参数不能有默认值” 下面是错误: ValueError Traceback (most recent call last) <ipython-input-1-a0d2faabd9e9> in <module> ----> 1 import matplotlib.pyplot as plt ~\App

从昨天开始

import matplotlib.pyplot as plt 
给我这个值错误“可变关键字参数不能有默认值”

下面是错误:

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
ValueError回溯(最近一次调用)
在里面
---->1将matplotlib.pyplot作为plt导入
中的~\AppData\Roaming\Python\Python37\site packages\matplotlib\pyplot.py
30来自cycler导入cycler
31导入matplotlib
--->32导入matplotlib.colorbar
33导入matplotlib.image
34从matplotlib导入rcsetup,样式
中的~\AppData\Roaming\Python\Python37\site packages\matplotlib\colorbar.py
38
39将matplotlib导入为mpl
--->40导入matplotlib.artist作为martist
41将matplotlib.cbook作为cbook导入
42将matplotlib.collections导入为集合
中的~\AppData\Roaming\Python\Python37\site packages\matplotlib\artist.py
58
59
--->60级艺术家:
61     """
62呈现为FigureCanvas的对象的抽象基类。
艺术家()中的~\AppData\Roaming\Python\Python37\site packages\matplotlib\artist.py
899
900@cbook.\u删除\u参数(“3.3”、“args”)
-->901@cbook.\u删除\u参数(“3.3”、“kwargs”)
902 def绘图(自身、渲染器、*args、**kwargs):
903         """
~\AppData\Roaming\Python\Python37\site packages\matplotlib\cbook\deprecation.py in\u delete\u参数(自,名称,func)
343如果param.name==name,则param.replace(默认值=_不推荐的_参数)
344其他参数
-->345用于signature.parameters.values()中的参数)
346
347@functools.wrapps(func)
(.0)中的~\AppData\Roaming\Python\Python37\site packages\matplotlib\cbook\deprecation.py
343如果param.name==name,则param.replace(默认值=_不推荐的_参数)
344其他参数
-->345用于signature.parameters.values()中的参数)
346
347@functools.wrapps(func)
替换中的~\Anaconda3\lib\inspect.py(self、name、kind、annotation、default)
2547默认值=self.\u默认值
2548
->2549返回类型(自身)(名称、种类、默认值=默认值、注释=注释)
2550
2551 def_uuustr_uuu(自):
~\Anaconda3\lib\inspect.py在\uuuuu init\uuuuu中(self、name、kind、default、annotation)
2474 msg='{}参数不能有默认值'
2475 msg=msg.format(_get_paramkind_descr(self._kind))
->2476提升值错误(msg)
2477 self.\u default=默认值
2478自我注释=注释
ValueError:可变关键字参数不能有默认值
我尝试卸载matplotlib并重新安装,然后安装不同的版本,但似乎没有任何效果

有人有其他想法吗?
谢谢

您使用的是一个非常旧的Python版本(3.7)。也许可以尝试升级到最新版本?我试过了,但没有成功。最后我冻结了环境并重新安装了Anaconda。现在它起作用了