This question is similar to the ones here and here but none of the solutions there work perhaps because I′m using a different environment (PyCharm on Mac OS).
In a virtual environment with PyCharm running on 2.7.15, matplotlib installed without any complaints, and a one-line PyCharm python file with the following content...
import matplotlib.pyplot as plt
...the console outputs the following error when running this one-line file:
/Users/jbs/PycharmProjects/WakeUp/env/bin/python /Users/jbs/PycharmProjects/WakeUp/InputSound/WakeInputSound-and-plot-it-trial3.py
Traceback (most recent call last):
File "/Users/jbs/PycharmProjects/WakeUp/InputSound/WakeInputSound-and-plot-it-trial3.py", line 2, in <module>
import matplotlib.pyplot as plt
File "/Users/jbs/PycharmProjects/WakeUp/env/lib/python2.7/site-packages/matplotlib/pyplot.py", line 115, in <module>
_backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
File "/Users/jbs/PycharmProjects/WakeUp/env/lib/python2.7/site-packages/matplotlib/backends/__init__.py", line 62, in pylab_setup
[backend_name], 0)
File "/Users/jbs/PycharmProjects/WakeUp/env/lib/python2.7/site-packages/matplotlib/backends/backend_macosx.py", line 17, in <module>
from matplotlib.backends import _macosx
RuntimeError: 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.
Any help resolving this would be most welcomed. I′ve tried about a dozen things and none seems to work...
(import matplotlib alone does not give problems and this question may be related to this one but it′s clearly different...)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…