I installed matplot.lib by using the command sudo apt-get install python3-matplotlib.
While running a program written in python it is showing
Traceback (most recent call last): File "example.py", line 6, in <module> import matplotlib.pyplot as plt
ImportError: No module named matplotlib.pyplotWhat is the problem and how do I install matplotlib properly?
I am trying to run a program that calculates refractive index and the link is
72 Answers
apt-get install python3-matplotlib ...... it is python 2.7.12 : import matplotlib.pyplot as plt
python 2.7.12 is not using 'python3-matplotlib', but python-matplotlib.
Please install python-matplotlib too
Try installing matplotlib using pip
pip3 install matplotlibAnd if pip3 is not installed on your system try installing pip using following command
sudo apt-get install -y python3-pip