Python Library Installation required.


I want to run "matplotlib" with import (import matplotlib.pyplot as plt), but show syntex error. Then after I applied <pip install matplotlib> to install but still shows error.

2 Answers

4 months ago by

Here's the corrected code for your main.py file:

import matplotlib.pyplot as plt

You can't use pip install in the script; instead, make sure to install matplotlib

via command line before running this script.

Make sure to install matplotlib using the command line before executing the script:

pip install matplotlib
This will ensure that the library is available for your Python script.

4 months ago by LMARK CODES

Where I can found out the command line? I am testing code at this link.https://onecompiler.com/python2/439ejb5wq

4 months ago by deleted_user_4392mhagm