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

前端 未结 7 1490
粉色の甜心
粉色の甜心 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 08:08

    This solution worked for me. If you already installed matplotlib using pip on your virtual environment, you can just type the following:

    $ cd ~/.matplotlib
    $ nano matplotlibrc
    

    And then, write backend: TkAgg in there. If you need more information, just go to the solution link.

提交回复
热议问题