Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ImportError: No module names 'matplotlib' Python 3.3

I'm new to python (started 2 days ago) and I have gotten to the point where I want to use matplotlib for my program. I am using python 3.3 and after I have followed the instructions of installing matplotlib I've gone through the following steps:

sudo apt-get install python-pip
sudo pip install matplotlib

That returned this import error:

ImportError: No module named 'matplotlib'

So after some research I tried this:

sudo apt-get update
sudo apt-get build-dep python-matplot

I'm still getting the same import error. I have found this page here: https://askubuntu.com/questions/427708/matplotlib-error-no-module-named-matplotlib-even-though-it-is-installed

This has given me the impression that I have installed the incorrect version of matplotlib and that I need v1.2 or higher. Can someone explain to me what I need to do to be able to use matplotlib and not get this error with Python 3.3?

I'm currently using Ubuntu 12.04.

Thank you.

like image 544
War Gravy Avatar asked Oct 02 '14 06:10

War Gravy


1 Answers

On my Mint 17 I just did, with Python 3.4 (would recommend that as you just start with Python, unless you need some library which does not yet support 3.4):

sudo pip3 install matplotlib

Then test the install:

python3

import matplotlib
matplotlib.__version__

Should give you '1.4.0'

like image 69
Werner Avatar answered Oct 25 '22 21:10

Werner