首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >在导入matplotlib时,我得到了下面的错误

在导入matplotlib时,我得到了下面的错误
EN

Stack Overflow用户
提问于 2022-07-23 19:48:39
回答 1查看 35关注 0票数 0
代码语言:javascript
运行
复制
File c:\Users\USER\OneDrive\Desktop\Python\lib\site-packages\matplotlib\__init__.py:877, in <module>
    870     return config
    873 # When constructing the global instances, we need to perform certain updates
    874 # by explicitly calling the superclass (dict.update, dict.items) to avoid
    875 # triggering resolution of _auto_backend_sentinel.
    876 rcParamsDefault = _rc_params_in_file(
--> 877     cbook._get_data_path("matplotlibrc"),
    878     # Strip leading comment.
    879     transform=lambda line: line[1:] if line.startswith("#") else line,
    880     fail_on_error=True)
    881 dict.update(rcParamsDefault, rcsetup._hardcoded_defaults)
    882 # Normally, the default matplotlibrc file contains *no* entry for backend (the
    883 # corresponding line starts with ##, not #; we fill on _auto_backend_sentinel
    884 # in that case.  However, packagers can set a different default backend
    885 # (resulting in a normal `#backend: foo` line) in which case we should *not*
    886 # fill in _auto_backend_sentinel.

File c:\Users\USER\OneDrive\Desktop\Python\lib\site-packages\matplotlib\cbook\__init__.py:518, in _get_data_path(*args)
    512 def _get_data_path(*args):
    513     """
    221     return props[name].__get__(instance)
--> 222 raise AttributeError(
    223     f"module {cls.__module__!r} has no attribute {name!r}")

AttributeError: module 'matplotlib' has no attribute 'get_data_path'
EN

回答 1

Stack Overflow用户

发布于 2022-07-23 20:02:47

在虚拟环境中尝试这一点,它在那里应该是理想的。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73093784

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档