报错:No module named mpl_toolkits解决方案

明明有这个库的代码,但是依然报错找不到module:

报错:No module named mpl_toolkits解决方案_第1张图片


尝试更新matplotlib库,还真解决了这个问题:

$sudo pip install matplotlib --upgrade

如果更新的时候遇到uninstall six库报错,那么可以修改命令如下,跳过six的更新,详见另一篇博文http://blog.csdn.net/somilong/article/details/79399248

$sudo pip install matplotlib --upgrade --ignore-installed six

Collecting matplotlib
  Downloading matplotlib-2.1.2-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (13.2MB)
    100% |████████████████████████████████| 13.2MB 95kB/s
Collecting six
  Downloading six-1.11.0-py2.py3-none-any.whl
Collecting python-dateutil>=2.1 (from matplotlib)
  Downloading python_dateutil-2.6.1-py2.py3-none-any.whl (194kB)
    100% |████████████████████████████████| 194kB 3.8MB/s
Collecting pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 (from matplotlib)
  Downloading pyparsing-2.2.0-py2.py3-none-any.whl (56kB)
    100% |████████████████████████████████| 61kB 7.1MB/s
Collecting numpy>=1.7.1 (from matplotlib)
  Downloading numpy-1.14.1-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (4.7MB)
    100% |████████████████████████████████| 4.7MB 275kB/s
Collecting pytz (from matplotlib)
  Downloading pytz-2018.3-py2.py3-none-any.whl (509kB)
    100% |████████████████████████████████| 512kB 2.3MB/s
Collecting backports.functools-lru-cache (from matplotlib)
  Downloading backports.functools_lru_cache-1.5-py2.py3-none-any.whl
Collecting cycler>=0.10 (from matplotlib)
  Downloading cycler-0.10.0-py2.py3-none-any.whl
Collecting subprocess32 (from matplotlib)
  Downloading subprocess32-3.2.7.tar.gz (54kB)
    100% |████████████████████████████████| 61kB 4.5MB/s
Installing collected packages: six, python-dateutil, pyparsing, numpy, pytz, backports.functools-lru-cache, cycler, subprocess32, matplotlib
  Running setup.py install for subprocess32 ... done
Successfully installed backports.functools-lru-cache-1.5 cycler-0.10.0 matplotlib-2.1.2 numpy-1.14.1 pyparsing-2.2.0 python-dateutil-2.6.1 pytz-2018.3 six-1.11.0 subprocess32-3.2.7

你可能感兴趣的:(machine-learn)