watson-developer-cloud / assistant-improve-recommendations-notebook

Assistant Improve notebooks for Watson Assistant
Apache License 2.0
68 stars 67 forks source link

KeyError: 'scale' when importing functions in measure notebook #140

Open francescomanfrediextra opened 2 years ago

francescomanfrediextra commented 2 years ago

I've got the following exception while trying to run the Measure Notebook, specifically in the step importing the required functions:

KeyError                                  Traceback (most recent call last)
<ipython-input-3-7f29eac70671> in <module>
     10 
     11 # Import the visualization related functions
---> 12 from assistant_improve_toolkit.visualize_func import make_pie, coverage_barh, width_bar, show_coverage_over_time
     13 # Import Cloud Object Storage related functions
     14 from assistant_improve_toolkit.cos_op import generate_link, generate_excel_measure, export_result_excel

~/.local/lib/python3.8/site-packages/assistant_improve_toolkit/visualize_func.py in <module>
     15 # limitations under the License.
     16 
---> 17 import matplotlib.pyplot as plt
     18 import matplotlib as mpl
     19 import numpy as np

~/.local/lib/python3.8/site-packages/matplotlib/pyplot.py in <module>
     38 from matplotlib import docstring
     39 from matplotlib.backend_bases import FigureCanvasBase
---> 40 from matplotlib.figure import Figure, figaspect
     41 from matplotlib.gridspec import GridSpec
     42 from matplotlib import rcParams, rcParamsDefault, get_backend, rcParamsOrig

~/.local/lib/python3.8/site-packages/matplotlib/figure.py in <module>
     18 
     19 from matplotlib import rcParams
---> 20 from matplotlib import backends, docstring, projections
     21 from matplotlib import __version__ as _mpl_version
     22 from matplotlib import get_backend

~/.local/lib/python3.8/site-packages/matplotlib/projections/__init__.py in <module>
      2 from .geo import AitoffAxes, HammerAxes, LambertAxes, MollweideAxes
      3 from .polar import PolarAxes
----> 4 from mpl_toolkits.mplot3d import Axes3D
      5 
      6 

/usr/lib/python3/dist-packages/mpl_toolkits/mplot3d/__init__.py in <module>
----> 1 from .axes3d import Axes3D

/usr/lib/python3/dist-packages/mpl_toolkits/mplot3d/axes3d.py in <module>
     40 
     41 
---> 42 class Axes3D(Axes):
     43     """
     44     3D axes object.

/usr/lib/python3/dist-packages/mpl_toolkits/mplot3d/axes3d.py in Axes3D()
     48 
     49     @docstring.dedent_interpd
---> 50     def __init__(
     51             self, fig, rect=None, *args,
     52             azim=-60, elev=30, zscale=None, sharez=None, proj_type='persp',

~/.local/lib/python3.8/site-packages/matplotlib/docstring.py in dedent_interpd(func)
    114     """Dedent *func*'s docstring, then interpolate it with ``interpd``."""
    115     func.__doc__ = inspect.getdoc(func)
--> 116     return interpd(func)
    117 
    118 

~/.local/lib/python3.8/site-packages/matplotlib/docstring.py in __call__(self, func)
     38     def __call__(self, func):
     39         if func.__doc__:
---> 40             func.__doc__ %= self.params
     41         return func
     42 

KeyError: 'scale'

I was not able to debug it as the keyword "scale" does not seem to appear anywhere.

zairahms commented 2 years ago

Hi @francescomanfrediextra thanks for opening the issue. I will take a look at this.

francescomanfrediextra commented 2 years ago

I'm also attaching the result from pip3 freeze on my system. Hope it will prove useful to know the versions of each python module involved. Thank you. freeze.txt

zairahms commented 2 years ago

Thanks @francescomanfrediextra

Could you try changing the second cell in the notebook to !pip3 install --user --upgrade "assistant-improve-toolkit";

Let me know if this resolves the import issue.

francescomanfrediextra commented 2 years ago

Thank you @zairah10 , that solved the problem!