Issue
Today(Mar 30, 2021) I upgraded matplotlib and seaborn package.
But, after that, I can't import matplotlib and seaborn package.
Whenever I tried importing matplotlib or seaborn, I got error messages like below.
How can I solve this problem?
(I used JupyterLab 3.0)
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-33-a0d2faabd9e9> in <module>
----> 1 import matplotlib.pyplot as plt
C:\dev\anaconda3\lib\site-packages\matplotlib\__init__.py in <module>
819 # triggering resolution of _auto_backend_sentinel.
820 rcParamsDefault = _rc_params_in_file(
--> 821 cbook._get_data_path("matplotlibrc"),
822 # Strip leading comment.
823 transform=lambda line: line[1:] if line.startswith("#") else line,
C:\dev\anaconda3\lib\site-packages\matplotlib\cbook\__init__.py in _get_data_path(*args)
478 if opened:
479 with fh:
--> 480 yield fh
481 else:
482 yield fh
AttributeError: module 'matplotlib' has no attribute 'get_data_path'
Solution
These kinds of errors are typical for a version conflict, especially if you recently upgraded.
A common mistake is to just upgrade one package and expect that everything else will continue to work. Certain versions of libraries are only compatible with certain versions of other libraries and so on. Reality is that you have to find a working combination of all the libraries as a whole. From your example it is impossible to know what went wrong, but I would assume that you also have to upgrade the maptplotlib dependencies, and possibly their dependencies too.
If you are not closely familiar with those libraries, it can get tricky to chase this down, so you might be better off by simply reinstalling everything through pip
or some other dependency-aware package manager.
Answered By - jurez
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.