虚拟环境无法使用matplotlib问题

在python虚拟环境下直接使用matplotlib会报错

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.

安装完matplotlib的后会新建一个文件夹~/.matplotlib。
【虚拟环境无法使用matplotlib问题】在该文件夹里面新建一个matplotlibrc文件,往里面写:
backend: TkAgg

    推荐阅读