Como faço para instalar corretamente o matplotlib?

0

Eu instalei o matplot.lib usando o comando sudo apt-get install python3-matplotlib .

Durante a execução de um programa escrito em python, ele está sendo exibido

Traceback (most recent call last):
  File "example.py", line 6, in <module>
    import matplotlib.pyplot as plt
ImportError: No module named matplotlib.pyplot

Qual é o problema e como eu instalo o matplotlib corretamente?

Estou tentando executar um programa que calcula o índice de refração e o link é link

    
por Atrayee Hazra 17.05.2018 / 15:23

2 respostas

2

apt-get install python3-matplotlib ...... it is python 2.7.12 : import matplotlib.pyplot as plt

python 2.7.12 não está usando 'python3-matplotlib', mas python-matplotlib.

Por favor, instale python-matplotlib também

    
por Knud Larsen 19.05.2018 / 11:10
1

Tente instalar o matplotlib usando pip

pip3 install matplotlib

E se o pip3 não estiver instalado no seu sistema, tente instalar o pip usando o seguinte comando

sudo apt-get install -y python3-pip
    
por salmanarshad1999 19.05.2018 / 15:46