python - 全新安装的 matplotlib 中缺少 cbook
问题描述
我通过 pip 安装了 ipython 和 matplot lib
当我尝试时import matplotlib.pyplot as plt
,我收到此错误:
bash-4.2$ ipython
Python 3.6.3 (default, Jan 4 2018, 16:40:53)
Type 'copyright', 'credits' or 'license' for more information
IPython 6.4.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: import matplotlib.pyplot as plt
---------------------------------------------------------------------------
ImportError
Traceback (most recent call last)
<ipython-input-4-a0d2faabd9e9> in <module>()
----> 1 import matplotlib.pyplot as plt
~/.local/lib/python3.6/site-packages/matplotlib/__init__.py in <module>()
125 # cbook must import matplotlib only within function
126 # definitions, so it is safe to import from it here.
--> 127 from . import cbook
128 from matplotlib.cbook import (
129 _backports, mplDeprecation, dedent, get_label, sanitize_sequence)
ImportError: cannot import name 'cbook'
我怎样才能解决这个问题?
解决方案
推荐阅读
- jenkins - Jenkins 中的 RBAC:如何仅为用户和组管理创建自定义权限
- php - 如何存储具有动态选项和多个级别的各种嵌套列表?
- python-3.x - Flask 应用程序未返回预测值
- java - 在 RecyclerView 中创建 onClickListener
- css - 请问这里的解决方案是什么?问题是图像中我的名字“Samuel Oniyilo”之间的空格
- android - 钛中 AndroidManifest 中“android:targetSandboxVersion”属性的值无效
- javascript - 如何从创建的元素中的组中获取数组的值
- c++ - 遇到空行时停止输入
- python - 处理py中的异常,程序不给出输出
- mysql - 使用带有 MyISAM 的 Mysql 作为带有石英调度程序的数据库引擎