Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: cannot import name '_check_savefig_extra_args' from 'matplotlib.backend_bases' #574

Closed
qiankeqin opened this issue Sep 8, 2020 · 1 comment

Comments

@qiankeqin
Copy link

Summarize dataset: 72%
18/25 [00:03<00:01, 4.53it/s, Get scatter matrix]


ImportError Traceback (most recent call last)
~/opt/anaconda3/lib/python3.7/site-packages/IPython/core/formatters.py in call(self, obj)
343 method = get_real_method(obj, self.print_method)
344 if method is not None:
--> 345 return method()
346 return None
347 else:

~/opt/anaconda3/lib/python3.7/site-packages/pandas_profiling/profile_report.py in repr_html(self)
407 def repr_html(self):
408 """The ipython notebook widgets user interface gets called by the jupyter notebook."""
--> 409 self.to_notebook_iframe()
410
411 def repr(self):

~/opt/anaconda3/lib/python3.7/site-packages/pandas_profiling/profile_report.py in to_notebook_iframe(self)
387 with warnings.catch_warnings():
388 warnings.simplefilter("ignore")
--> 389 display(get_notebook_iframe(self))
390
391 def to_widgets(self):

~/opt/anaconda3/lib/python3.7/site-packages/pandas_profiling/report/presentation/flavours/widget/notebook.py in get_notebook_iframe(profile)
63 output = get_notebook_iframe_src(profile)
64 elif attribute == "srcdoc":
---> 65 output = get_notebook_iframe_srcdoc(profile)
66 else:
67 raise ValueError(

~/opt/anaconda3/lib/python3.7/site-packages/pandas_profiling/report/presentation/flavours/widget/notebook.py in get_notebook_iframe_srcdoc(profile)
21 width = config["notebook"]["iframe"]["width"].get(str)
22 height = config["notebook"]["iframe"]["height"].get(str)
---> 23 src = html.escape(profile.to_html())
24
25 iframe = f'<iframe width="{width}" height="{height}" srcdoc="{src}" frameborder="0" allowfullscreen></iframe>'

~/opt/anaconda3/lib/python3.7/site-packages/pandas_profiling/profile_report.py in to_html(self)
357
358 """
--> 359 return self.html
360
361 def to_json(self) -> str:

~/opt/anaconda3/lib/python3.7/site-packages/pandas_profiling/profile_report.py in html(self)
177 def html(self):
178 if self._html is None:
--> 179 self._html = self._render_html()
180 return self._html
181

~/opt/anaconda3/lib/python3.7/site-packages/pandas_profiling/profile_report.py in _render_html(self)
284 from pandas_profiling.report.presentation.flavours import HTMLReport
285
--> 286 report = self.report
287
288 disable_progress_bar = not config["progress_bar"].get(bool)

~/opt/anaconda3/lib/python3.7/site-packages/pandas_profiling/profile_report.py in report(self)
171 def report(self):
172 if self._report is None:
--> 173 self._report = get_report_structure(self.description_set)
174 return self._report
175

~/opt/anaconda3/lib/python3.7/site-packages/pandas_profiling/profile_report.py in description_set(self)
152 def description_set(self):
153 if self._description_set is None:
--> 154 self._description_set = describe_df(self.title, self.df, self._sample)
155 return self._description_set
156

~/opt/anaconda3/lib/python3.7/site-packages/pandas_profiling/model/describe.py in describe(title, df, sample)
100 # Scatter matrix
101 pbar.set_postfix_str("Get scatter matrix")
--> 102 scatter_matrix = get_scatter_matrix(df, variables)
103 pbar.update()
104

~/opt/anaconda3/lib/python3.7/site-packages/pandas_profiling/model/summary.py in get_scatter_matrix(df, variables)
696 for y in continuous_variables:
697 if x in continuous_variables:
--> 698 scatter_matrix[x][y] = scatter_pairwise(df[x], df[y], x, y)
699 else:
700 scatter_matrix = {}

~/opt/anaconda3/lib/python3.7/contextlib.py in inner(*args, **kwds)
72 def inner(*args, **kwds):
73 with self._recreate_cm():
---> 74 return func(*args, **kwds)
75 return inner
76

~/opt/anaconda3/lib/python3.7/site-packages/pandas_profiling/visualisation/plot.py in scatter_pairwise(series1, series2, x_label, y_label)
277 else:
278 plt.scatter(series1[indices], series2[indices], color=color)
--> 279 return plot_360_n0sc0pe(plt)
280
281

~/opt/anaconda3/lib/python3.7/site-packages/pandas_profiling/visualisation/utils.py in plot_360_n0sc0pe(plt, image_format, attempts)
66 if image_format == "svg":
67 image_str = StringIO()
---> 68 plt.savefig(image_str, format=image_format)
69 image_str.seek(0)
70 result_string = image_str.getvalue()

~/opt/anaconda3/lib/python3.7/site-packages/matplotlib/pyplot.py in savefig(*args, **kwargs)
727 figManager = _pylab_helpers.Gcf.get_active()
728 if figManager is not None:
--> 729 return figManager.canvas.figure
730 else:
731 return figure()

~/opt/anaconda3/lib/python3.7/site-packages/matplotlib/figure.py in savefig(self, fname, transparent, **kwargs)
2178 frameon=None, metadata=None)
2179
-> 2180 The available output formats depend on the backend being used.
2181
2182 Parameters

~/opt/anaconda3/lib/python3.7/site-packages/matplotlib/backend_bases.py in print_figure(self, filename, dpi, facecolor, edgecolor, orientation, format, bbox_inches, **kwargs)
2021 def get_width_height(self):
2022 """
-> 2023 Return the figure width and height in points or pixels
2024 (depending on the backend), truncated to integers.
2025 """

~/opt/anaconda3/lib/python3.7/site-packages/matplotlib/backend_bases.py in _get_output_canvas(self, fmt)
1957 (x, y) pixel positions from left/bottom of the canvas.
1958
-> 1959 Returns
1960 -------
1961 ~matplotlib.axes.Axes or None

~/opt/anaconda3/lib/python3.7/site-packages/matplotlib/backend_bases.py in get_registered_canvas_class(format)
123 An abstract base class to handle drawing/rendering operations.
124
--> 125 The following methods must be implemented in the backend for full
126 functionality (though just implementing :meth:draw_path alone would
127 give a highly capable backend):

~/opt/anaconda3/lib/python3.7/importlib/init.py in import_module(name, package)
125 break
126 level += 1
--> 127 return _bootstrap._gcd_import(name[level:], package, level)
128
129

~/opt/anaconda3/lib/python3.7/importlib/_bootstrap.py in _gcd_import(name, package, level)

~/opt/anaconda3/lib/python3.7/importlib/_bootstrap.py in find_and_load(name, import)

~/opt/anaconda3/lib/python3.7/importlib/_bootstrap.py in find_and_load_unlocked(name, import)

~/opt/anaconda3/lib/python3.7/importlib/_bootstrap.py in _load_unlocked(spec)

~/opt/anaconda3/lib/python3.7/importlib/_bootstrap_external.py in exec_module(self, module)

~/opt/anaconda3/lib/python3.7/importlib/_bootstrap.py in _call_with_frames_removed(f, *args, **kwds)

~/opt/anaconda3/lib/python3.7/site-packages/matplotlib/backends/backend_svg.py in
16 import matplotlib as mpl
17 from matplotlib import cbook
---> 18 from matplotlib.backend_bases import (
19 _Backend, _check_savefig_extra_args, FigureCanvasBase, FigureManagerBase,
20 RendererBase)

ImportError: cannot import name '_check_savefig_extra_args' from 'matplotlib.backend_bases' (/Users/qiankeqin/opt/anaconda3/lib/python3.7/site-packages/matplotlib/backend_bases.py)

@sbrugman
Copy link
Collaborator

sbrugman commented Sep 8, 2020

@sbrugman sbrugman closed this as completed Sep 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants