matplotlib: RuntimeError: Python is not installed as a framework

前端 未结 6 2191
情深已故
情深已故 2020-12-23 14:04

This question has been asked before, in here, also here. However, the solution didn\'t fix the problem for my case.

The original error is, when I try to impor

6条回答
  •  伪装坚强ぢ
    2020-12-23 14:27

    I run my script in virtualenv. Python version is 3.5.

    Add a line:

    backend: TkAgg
    

    in file:

    ~/.matplotlib/matplotlibrc
    

    This solved the problem.

    If you want to know more about why adding this solves the problem, you can read about customizing matplotlib's backend. And TkAgg solves this issue because of it's dependency with Tkinter.

提交回复
热议问题