Unable to “import matplotlib.pyplot as plt” in virtualenv

前端 未结 7 1491
粉色の甜心
粉色の甜心 2020-12-04 07:39

I am working with flask in a virtual environment. I was able to install matplotlib with pip, and I can import matplotlib in a Python session. However, when I im

7条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-04 07:55

    You can fix this issue by using the backend Agg

    Go to User/yourname/.matplotlib and open/create matplotlibrc and add the following line backend : Agg and it should work for you.

提交回复
热议问题