mac anaconda安装matplotlib

网友投稿 615 2022-11-06


mac anaconda安装matplotlib

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

pip install matplotlib

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

Traceback (most recent call last): File "manage.py", line 8, in from main import speechRecorder File "/Users/admin/Documents/pythonFiles/CASR-DEMO/speechV2.0/main/speechRecorder.py", line 4, in from main import CASR_model File "/Users/admin/Documents/pythonFiles/CASR-DEMO/speechV2.0/main/CASR_model.py", line 11, in from .SpeechModel251 import ModelSpeech File "/Users/admin/Documents/pythonFiles/CASR-DEMO/speechV2.0/main/SpeechModel251.py", line 10, in from general_function.file_wav import * File "/Users/admin/Documents/pythonFiles/CASR-DEMO/speechV2.0/general_function/file_wav.py", line 7, in import matplotlib.pyplot as plt File "/Users/admin/anaconda3/envs/speech/lib/python3.5/site-packages/matplotlib/pyplot.py", line 2371, in 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 from matplotlib.backends import _macosxImportError: 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://jianshu.com/p/0d166eb781f3​​


版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:Java中数组的定义和使用教程(二)
下一篇:mac python2.7 ERROR: Cannot uninstall 'numpy'. It is a distutils installed project an
相关文章

 发表评论

暂时没有评论,来抢沙发吧~