How do I properly install matplotlib?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
0
down vote

favorite












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.pyplot


What 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 https://github.com/polyanskiy/refractiveindex.info-scripts







share|improve this question


















  • 1




    Possible duplicate of Installing matplotlib on Ubuntu 14.04 after installing Python 3 with pyenv
    – Eskander Bejaoui
    May 17 at 13:31






  • 1




    Welcome to Ask Ubuntu! Could you please edit question to add a few details for clarification? What's the program? How did you install the Python interpreter in question and the mathplotlib module? Thanks.
    – David Foerster
    May 17 at 13:42










  • i have tried it by the command "sudo apt-get install python3-matplotlib". then when i have tried to run the program there is another problem saying Traceback (most recent call last): File "example.py", line 6, in <module> import matplotlib.pyplot as plt ImportError: No module named matplotlib.pyplot wht is the problem and how to install the matplotlib properly?
    – Atrayee Hazra
    May 17 at 13:44










  • @AtrayeeHazra It depends on how you installed Python. Tell us how you installed Python and what the output of which python or which python3 is.
    – Steve
    May 17 at 13:49






  • 1




    »python 2.7.12« is not using 'python3-matplotlib', but python-matplotlib. Please install python-matplotlib too.
    – Knud Larsen
    May 17 at 14:02














up vote
0
down vote

favorite












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.pyplot


What 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 https://github.com/polyanskiy/refractiveindex.info-scripts







share|improve this question


















  • 1




    Possible duplicate of Installing matplotlib on Ubuntu 14.04 after installing Python 3 with pyenv
    – Eskander Bejaoui
    May 17 at 13:31






  • 1




    Welcome to Ask Ubuntu! Could you please edit question to add a few details for clarification? What's the program? How did you install the Python interpreter in question and the mathplotlib module? Thanks.
    – David Foerster
    May 17 at 13:42










  • i have tried it by the command "sudo apt-get install python3-matplotlib". then when i have tried to run the program there is another problem saying Traceback (most recent call last): File "example.py", line 6, in <module> import matplotlib.pyplot as plt ImportError: No module named matplotlib.pyplot wht is the problem and how to install the matplotlib properly?
    – Atrayee Hazra
    May 17 at 13:44










  • @AtrayeeHazra It depends on how you installed Python. Tell us how you installed Python and what the output of which python or which python3 is.
    – Steve
    May 17 at 13:49






  • 1




    »python 2.7.12« is not using 'python3-matplotlib', but python-matplotlib. Please install python-matplotlib too.
    – Knud Larsen
    May 17 at 14:02












up vote
0
down vote

favorite









up vote
0
down vote

favorite











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.pyplot


What 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 https://github.com/polyanskiy/refractiveindex.info-scripts







share|improve this question














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.pyplot


What 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 https://github.com/polyanskiy/refractiveindex.info-scripts









share|improve this question













share|improve this question




share|improve this question








edited May 17 at 17:13









Martin Thornton

2,38541730




2,38541730










asked May 17 at 13:23









Atrayee Hazra

212




212







  • 1




    Possible duplicate of Installing matplotlib on Ubuntu 14.04 after installing Python 3 with pyenv
    – Eskander Bejaoui
    May 17 at 13:31






  • 1




    Welcome to Ask Ubuntu! Could you please edit question to add a few details for clarification? What's the program? How did you install the Python interpreter in question and the mathplotlib module? Thanks.
    – David Foerster
    May 17 at 13:42










  • i have tried it by the command "sudo apt-get install python3-matplotlib". then when i have tried to run the program there is another problem saying Traceback (most recent call last): File "example.py", line 6, in <module> import matplotlib.pyplot as plt ImportError: No module named matplotlib.pyplot wht is the problem and how to install the matplotlib properly?
    – Atrayee Hazra
    May 17 at 13:44










  • @AtrayeeHazra It depends on how you installed Python. Tell us how you installed Python and what the output of which python or which python3 is.
    – Steve
    May 17 at 13:49






  • 1




    »python 2.7.12« is not using 'python3-matplotlib', but python-matplotlib. Please install python-matplotlib too.
    – Knud Larsen
    May 17 at 14:02












  • 1




    Possible duplicate of Installing matplotlib on Ubuntu 14.04 after installing Python 3 with pyenv
    – Eskander Bejaoui
    May 17 at 13:31






  • 1




    Welcome to Ask Ubuntu! Could you please edit question to add a few details for clarification? What's the program? How did you install the Python interpreter in question and the mathplotlib module? Thanks.
    – David Foerster
    May 17 at 13:42










  • i have tried it by the command "sudo apt-get install python3-matplotlib". then when i have tried to run the program there is another problem saying Traceback (most recent call last): File "example.py", line 6, in <module> import matplotlib.pyplot as plt ImportError: No module named matplotlib.pyplot wht is the problem and how to install the matplotlib properly?
    – Atrayee Hazra
    May 17 at 13:44










  • @AtrayeeHazra It depends on how you installed Python. Tell us how you installed Python and what the output of which python or which python3 is.
    – Steve
    May 17 at 13:49






  • 1




    »python 2.7.12« is not using 'python3-matplotlib', but python-matplotlib. Please install python-matplotlib too.
    – Knud Larsen
    May 17 at 14:02







1




1




Possible duplicate of Installing matplotlib on Ubuntu 14.04 after installing Python 3 with pyenv
– Eskander Bejaoui
May 17 at 13:31




Possible duplicate of Installing matplotlib on Ubuntu 14.04 after installing Python 3 with pyenv
– Eskander Bejaoui
May 17 at 13:31




1




1




Welcome to Ask Ubuntu! Could you please edit question to add a few details for clarification? What's the program? How did you install the Python interpreter in question and the mathplotlib module? Thanks.
– David Foerster
May 17 at 13:42




Welcome to Ask Ubuntu! Could you please edit question to add a few details for clarification? What's the program? How did you install the Python interpreter in question and the mathplotlib module? Thanks.
– David Foerster
May 17 at 13:42












i have tried it by the command "sudo apt-get install python3-matplotlib". then when i have tried to run the program there is another problem saying Traceback (most recent call last): File "example.py", line 6, in <module> import matplotlib.pyplot as plt ImportError: No module named matplotlib.pyplot wht is the problem and how to install the matplotlib properly?
– Atrayee Hazra
May 17 at 13:44




i have tried it by the command "sudo apt-get install python3-matplotlib". then when i have tried to run the program there is another problem saying Traceback (most recent call last): File "example.py", line 6, in <module> import matplotlib.pyplot as plt ImportError: No module named matplotlib.pyplot wht is the problem and how to install the matplotlib properly?
– Atrayee Hazra
May 17 at 13:44












@AtrayeeHazra It depends on how you installed Python. Tell us how you installed Python and what the output of which python or which python3 is.
– Steve
May 17 at 13:49




@AtrayeeHazra It depends on how you installed Python. Tell us how you installed Python and what the output of which python or which python3 is.
– Steve
May 17 at 13:49




1




1




»python 2.7.12« is not using 'python3-matplotlib', but python-matplotlib. Please install python-matplotlib too.
– Knud Larsen
May 17 at 14:02




»python 2.7.12« is not using 'python3-matplotlib', but python-matplotlib. Please install python-matplotlib too.
– Knud Larsen
May 17 at 14:02










2 Answers
2






active

oldest

votes

















up vote
2
down vote














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






share|improve this answer



























    up vote
    1
    down vote













    Try installing matplotlib using pip



    pip3 install matplotlib


    And if pip3 is not installed on your system try installing pip using following command



    sudo apt-get install -y python3-pip





    share|improve this answer




















      Your Answer







      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "89"
      ;
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function()
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled)
      StackExchange.using("snippets", function()
      createEditor();
      );

      else
      createEditor();

      );

      function createEditor()
      StackExchange.prepareEditor(
      heartbeatType: 'answer',
      convertImagesToLinks: true,
      noModals: false,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );








       

      draft saved


      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1037410%2fhow-do-i-properly-install-matplotlib%23new-answer', 'question_page');

      );

      Post as a guest






























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      2
      down vote














      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






      share|improve this answer
























        up vote
        2
        down vote














        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






        share|improve this answer






















          up vote
          2
          down vote










          up vote
          2
          down vote










          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






          share|improve this answer













          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







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered May 19 at 9:10









          Knud Larsen

          1,441157




          1,441157






















              up vote
              1
              down vote













              Try installing matplotlib using pip



              pip3 install matplotlib


              And if pip3 is not installed on your system try installing pip using following command



              sudo apt-get install -y python3-pip





              share|improve this answer
























                up vote
                1
                down vote













                Try installing matplotlib using pip



                pip3 install matplotlib


                And if pip3 is not installed on your system try installing pip using following command



                sudo apt-get install -y python3-pip





                share|improve this answer






















                  up vote
                  1
                  down vote










                  up vote
                  1
                  down vote









                  Try installing matplotlib using pip



                  pip3 install matplotlib


                  And if pip3 is not installed on your system try installing pip using following command



                  sudo apt-get install -y python3-pip





                  share|improve this answer












                  Try installing matplotlib using pip



                  pip3 install matplotlib


                  And if pip3 is not installed on your system try installing pip using following command



                  sudo apt-get install -y python3-pip






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered May 19 at 13:46









                  salmanarshad1999

                  566




                  566






















                       

                      draft saved


                      draft discarded


























                       


                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1037410%2fhow-do-i-properly-install-matplotlib%23new-answer', 'question_page');

                      );

                      Post as a guest













































































                      Popular posts from this blog

                      Which professions warranted travel in Medieval times?

                      How do so many people here on Academia.SE, and in general, afford lavish higher education programs?

                      Trouble downloading packages list due to a “Hash sum mismatch” error