skip to Main Content
from matplotlib import pyplot as plt

Even though I installed matplotlib by pip in Vscode, it still says there is no module named "matplotlib". When I use Jupyter notebook instead it works. How can I use Matplotlib in Vscode?

2

Answers


  1. It seem likes you are installing in an enviroment and you run file with another enviroment. I was used to. For easy to use, you should open vscode from anacoda (with enviroment that has been install matplotlib), then the code will work

    Login or Signup to reply.
    1. First check the version of python you are using in your Jupyter Notebook.
    2. Make sure you are using the same version of python in vscode:

    Click {}python in the right bottom.

    enter image description here

    Then select the correct python version in the top middle.

    enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search