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

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

    A clean and easy solution is to create a kernel that sets PYTHONHOME to VIRTUAL_ENV and then uses the system Python executable (instead of the one in the virtualenv).

    If you want to automate the creation of such a kernel, you can use the jupyter-virtualenv-osx script.

提交回复
热议问题