Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

python 2.7 not installing matplotlib

Hi I'm trying to install matplotlib on my mac. I have lion OS X.

my python version is 2.7.1 ( this is what it says when I run it from terminal)

every time I install matplotlib, it promots this error

matplotlib 1.1.0 cannot be installed on this disk. matplotlib requires System python 2.7 to install. 

I'm new to the python world and I need a tool to graph a few things... so a clear explanation is much appreciated.

Thanks!

like image 811
Ka Ra Avatar asked Apr 26 '12 00:04

Ka Ra


Video Answer


2 Answers

You are installing a binary package which is going to expect a specific system python. You are better off building from source.

Just try installing it from pip:

pip install numpy 
pip install matplotlib

If you do not yet have pip, you can install it like this:

wget "http://peak.telecommunity.com/dist/ez_setup.py"
python ez_setup.py
easy_install pip

If any of this fails, then follow @Nolen Royalty's guide that he mentioned in the comments

like image 93
jdi Avatar answered Oct 12 '22 01:10

jdi


I've tried installing python in various different ways to get numpy, scipy, and matplotlib to all work together, and its a huge pain. Your exact version of python will dictate the version of numpy, scipy, and matlplotlib that will work for you.

By far, the easiest solution I have found is to use the pre-built package Enthought. It takes care of all of those problems with one easy installer. You might get some additional software installed like mayavi (an interactive 3d plotting tool), but its not too much.

If you are a student (or have ever been one since the dawn of email), you can download the entire Enthought package for free here. Or you can visit the Enthought home at www.enthought.com. All you have to do is select the academic license and then insert a email that ends in .edu.

I even think there are free trial versions which should solve the issue. I've never tried any of the trial versions, but even if it is a limited time trial, you should be able to use the trial version, and then see exactly which versions of each package you need to install. Its a little more roundabout, but it should work.

like image 29
HardcoreBro Avatar answered Oct 12 '22 02:10

HardcoreBro