How do I properly install matplotlib?

Clash 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
python
 |Â
show 2 more comments
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
python
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 themathplotlibmodule? 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 ofwhich pythonorwhich python3is.
â Steve
May 17 at 13:49
1
»python 2.7.12« is not using 'python3-matplotlib', butpython-matplotlib. Please installpython-matplotlibtoo.
â Knud Larsen
May 17 at 14:02
 |Â
show 2 more comments
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
python
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
python
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 themathplotlibmodule? 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 ofwhich pythonorwhich python3is.
â Steve
May 17 at 13:49
1
»python 2.7.12« is not using 'python3-matplotlib', butpython-matplotlib. Please installpython-matplotlibtoo.
â Knud Larsen
May 17 at 14:02
 |Â
show 2 more comments
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 themathplotlibmodule? 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 ofwhich pythonorwhich python3is.
â Steve
May 17 at 13:49
1
»python 2.7.12« is not using 'python3-matplotlib', butpython-matplotlib. Please installpython-matplotlibtoo.
â 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
 |Â
show 2 more comments
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
add a comment |Â
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
add a comment |Â
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
add a comment |Â
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
add a comment |Â
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
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
answered May 19 at 9:10
Knud Larsen
1,441157
1,441157
add a comment |Â
add a comment |Â
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
add a comment |Â
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
add a comment |Â
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
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
answered May 19 at 13:46
salmanarshad1999
566
566
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
mathplotlibmodule? 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 pythonorwhich python3is.â Steve
May 17 at 13:49
1
»python 2.7.12« is not using 'python3-matplotlib', but
python-matplotlib. Please installpython-matplotlibtoo.â Knud Larsen
May 17 at 14:02