mac anaconda安装matplotlib

今天在装matplotlib的时候,用的是pip命令安装的,命令为:

pip install matplotlib

但是不幸的是,运行程序的时候还是报错,错误信息为:

Traceback (most recent call last):
  File "manage.py", line 8, in <module>
    from main import speechRecorder
  File "/Users/admin/Documents/pythonFiles/CASR-DEMO/speechV2.0/main/speechRecorder.py", line 4, in <module>
    from main import CASR_model
  File "/Users/admin/Documents/pythonFiles/CASR-DEMO/speechV2.0/main/CASR_model.py", line 11, in <module>
    from .SpeechModel251 import ModelSpeech
  File "/Users/admin/Documents/pythonFiles/CASR-DEMO/speechV2.0/main/SpeechModel251.py", line 10, in <module>
    from general_function.file_wav import *
  File "/Users/admin/Documents/pythonFiles/CASR-DEMO/speechV2.0/general_function/file_wav.py", line 7, in <module>
    import matplotlib.pyplot as plt
  File "/Users/admin/anaconda3/envs/speech/lib/python3.5/site-packages/matplotlib/pyplot.py", line 2371, in <module>
    switch_backend(rcParams["backend"])
  File "/Users/admin/anaconda3/envs/speech/lib/python3.5/site-packages/matplotlib/pyplot.py", line 207, in switch_backend
    backend_mod = importlib.import_module(backend_name)
  File "/Users/admin/anaconda3/envs/speech/lib/python3.5/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "/Users/admin/anaconda3/envs/speech/lib/python3.5/site-packages/matplotlib/backends/backend_macosx.py", line 14, in <module>
    from matplotlib.backends import _macosx
ImportError: Python is not installed as a framework. The Mac OS X backend will not be able to function correctly if Python is not installed as a framework. See the Python documentation for more information on installing Python as a framework on Mac OS X. Please either reinstall Python as a framework, or try one of the other backends. If you are using (Ana)Conda please install python.app and replace the use of 'python' with 'pythonw'. See 'Working with Matplotlib on OSX' in the Matplotlib FAQ for more information.

解决方法

conda install matplotlib

参考文献

[1].Anaconda下安装matplotlib的方法(3). https://www.jianshu.com/p/0d166eb781f3

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

农民小飞侠

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值